« Back to overview

Enable touch id for sudo command in terminal. Use at your own risc, don't mess up the sudo file.


In the terminal,

sudo su
(echo "auth       sufficient     pam_tid.so" && cat /etc/pam.d/sudo) > /tmp/pam_tid.so

# check the file
cat /tmp/pam_tid.so

# move the file
mv /tmp/pam_tid.so /etc/pam.d/sudo

exit

Note, if you mess up, the default of /etc/pam.d/sudo looks like this:

# sudo: auth account password session
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

After the change it should look like this:

# 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