Created
November 25, 2021 13:24
-
-
Save rwoeber/1d2efcb9ecf5385f7e8260ced517832b to your computer and use it in GitHub Desktop.
Use Touch ID for Sudo on Mac (and survive system updates)
This file contains 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
# source https://news.ycombinator.com/item?id=26302139 | |
sudo() { | |
unset -f sudo | |
if [[ "$(uname)" == 'Darwin' ]] && ! grep 'pam_tid.so' /etc/pam.d/sudo --silent; then | |
sudo sed -i -e '1s;^;auth sufficient pam_tid.so\n;' /etc/pam.d/sudo | |
fi | |
sudo "$@" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment