Now that I've got a mac with TouchID, I rarely use my password. It's incredible how convenient that little button is. One place I found myself still typing my password was running
sudo commands in the terminal.
Here's how you can use TouchID with the terminal too!
Enabling TouchID with Sudo
First, open the
/etc/pam.d/sudo in an editor with admin permissions. I had to use
sudo to do this with the following command:
sudo code /etc/pam.d/sudo
auth sufficient pam_tid.so to the file, here's what mine looks like now:
(I only added the line with
pam_tid.so on it.)
# sudo: auth account password session auth sufficient pam_tid.so auth sufficient pam_smartcard.so auth required pam_opendirectory.so account required pam_permit.so password required pam_deny.so session required pam_permit.so
iTerm has an advanced option that you also need to set for this to work properly. Go to
Preferences ⇒ Advanced ⇒ Allow sessions to survive after logging out and back in
Change this setting to
Restart iTerm and try it out!