Skip to content

Instantly share code, notes, and snippets.

@agmm
Last active January 12, 2022 21:38
Show Gist options
  • Save agmm/7425375d4b4bfc88944f4389967960e4 to your computer and use it in GitHub Desktop.
Save agmm/7425375d4b4bfc88944f4389967960e4 to your computer and use it in GitHub Desktop.
Touch ID for sudo

How to use Touch ID for sudo access

  1. The first step is to open /etc/pam.d/sudo with sudo privileges.
sudo nano /etc/pam.d/sudo
  1. The next step is to add the following line to the top of the previous file.
auth sufficient pam_tid.so
  1. Now the file 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
  1. Save the file.

  2. Test the configuration by executing sudo ls. A Touch ID dialog should appear. If the dialog is cancelled the password will be prompted in the usual way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment