Last active
May 5, 2023 17:03
-
-
Save speelbarrow/e1002edcb1eac242c6c1dc7fc252e97f to your computer and use it in GitHub Desktop.
Enable TouchID for `sudo` on macOS
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 | |
# NOTE: This command will have to be run again every time the system is updated | |
if ! (sed -n 2p /etc/pam.d/sudo | grep -q "tid") | |
then | |
sudo sed -i -e "2s/^/auth sufficient pam_tid.so\n/" /etc/pam.d/sudo | |
else | |
echo "TouchID already enabled for sudoing" | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment