Today I Learned

A Zero One initiative

How to use TouchID for sudo access

If you’re on a Mac with TouchID, you can easily configure it to prompt for a TouchID scan alongside normal password auth when running a command via sudo.

  • Edit /etc/pam.d/sudo with sudo
  • Add this as the first line underneath the comment at the top:
auth sufficient pam_tid.so
  • Save the file, and the next time you require sudo, you should be greeted with a TouchID prompt.

Notes

  • I haven’t tested this on the new magic keyboards with integrated TouchID, but there’s no reason to believe it won’t work with these keyboards too.
  • You may need to reapply this config when MacOS updates