Skip to content

Instantly share code, notes, and snippets.

@speelbarrow
Last active May 5, 2023 17:03
Show Gist options
  • Save speelbarrow/e1002edcb1eac242c6c1dc7fc252e97f to your computer and use it in GitHub Desktop.
Save speelbarrow/e1002edcb1eac242c6c1dc7fc252e97f to your computer and use it in GitHub Desktop.
Enable TouchID for `sudo` on macOS
#!/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