Created
March 20, 2021 08:27
-
-
Save pich4ya/6ff60706a8a693929c6ada1f39875a41 to your computer and use it in GitHub Desktop.
Automatically enable Macbook Pro's Touch ID for sudo after MacOS version upgrade
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
# Automatically enable Macbook Pro's Touch ID for sudo after MacOS version upgrade | |
sudotouchid () { | |
if ! /usr/bin/grep -Fq "pam_tid.so" /etc/pam.d/sudo | |
then | |
# Use Touch ID to enable Touch ID for sudo | |
/usr/bin/osascript -e 'do shell script "/usr/bin/sed -i '' -e \"1s/^//p; 1s/^.*/auth sufficient pam_tid.so/\" /etc/pam.d/sudo" with administrator privileges' | |
fi | |
} | |
sudotouchid |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment