Skip to content

Instantly share code, notes, and snippets.

@agmm
Last active January 1, 2024 13:45
Show Gist options
  • Save agmm/ffc4c0d3d0ab683bb82e00a2c50eac09 to your computer and use it in GitHub Desktop.
Save agmm/ffc4c0d3d0ab683bb82e00a2c50eac09 to your computer and use it in GitHub Desktop.
Script to enable Touch ID authentication for sudo commands
#!/bin/bash
# Script to enable Touch ID authentication for sudo
echo "Current config:"
cat /etc/pam.d/sudo
echo "Press ENTER to continue"
read
echo "# 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" | sudo tee /etc/pam.d/sudo
echo "Done"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment