Last active
June 22, 2023 17:05
-
-
Save isaac-ped/80e4beed58cb2b1959e0276bc2cb42bc to your computer and use it in GitHub Desktop.
Enable touch-id authentication for sudo privileges on mac OS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# From: https://it.digitaino.com/use-touchid-to-authenticate-sudo-on-macos/ | |
# Check if it's already done | |
if grep 'auth[[:space:]]*sufficient[[:space:]]*pam_tid.so' /etc/pam.d/sudo; then | |
echo "Already done" | |
else | |
# One-liner to do it | |
sudo sed -i.backup 's/\(auth[[:space:]]*sufficient[[:space:]]*pam_smartcard.so\)/\1\nauth sufficient pam_tid.so/' /etc/pam.d/sudo | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment