Skip to content

Instantly share code, notes, and snippets.

@rwoeber
Created November 25, 2021 13:24
Show Gist options
  • Save rwoeber/1d2efcb9ecf5385f7e8260ced517832b to your computer and use it in GitHub Desktop.
Save rwoeber/1d2efcb9ecf5385f7e8260ced517832b to your computer and use it in GitHub Desktop.
Use Touch ID for Sudo on Mac (and survive system updates)
# 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