Skip to content

Instantly share code, notes, and snippets.

@henrik242
Last active December 5, 2023 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save henrik242/de6950822325399fa2e55b311dfe46ce to your computer and use it in GitHub Desktop.
Save henrik242/de6950822325399fa2e55b311dfe46ce to your computer and use it in GitHub Desktop.

Tired of typing your password for sudo? TouchID to the rescue!

brew install gnu-sed
sudo wget -O /usr/local/bin/fix-sudo https://gist.githubusercontent.com/henrik242/de6950822325399fa2e55b311dfe46ce/raw/fix-sudo
sudo chmod 755 /usr/local/bin/fix-sudo
echo 'grep -q pam_tid /etc/pam.d/sudo || echo PLEASE RUN fix-sudo' >> ~/.bash_profile
echo 'grep -q pam_tid /etc/pam.d/sudo || echo PLEASE RUN fix-sudo' >> ~/.zshrc
#!/usr/bin/env bash
# See https://apple.stackexchange.com/a/444202/5723
defaults write com.apple.security.authorization ignoreArd -bool TRUE
grep -q pam_tid /etc/pam.d/sudo || sudo gsed -i.bak '1s/^/auth sufficient pam_tid.so\n/' /etc/pam.d/sudo
grep -q pam_tid /etc/pam.d/su || sudo gsed -i.bak '1s/^/auth sufficient pam_tid.so\n/' /etc/pam.d/su
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment