Created
April 25, 2024 07:04
-
-
Save fathonix/df9cb35c3ef7ac76150315d316da931e to your computer and use it in GitHub Desktop.
Script to enable PAM authentication with Touch ID on macOS
This file contains hidden or 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
#!/bin/sh | |
# retouchid - Script to enable PAM authentication with Touch ID on macOS | |
# Licensed under MIT. (c) 2022 Aldo Adirajasa Fathoni | |
if grep -q pam_tid.so /etc/pam.d/sudo; then | |
echo "Already set. no need to update /etc/pam.d/sudo." | |
exit 0 | |
fi | |
if [ $(id -u) = 0 ];then | |
sed -i '' '2i\ | |
auth sufficient pam_tid.so\ | |
' /etc/pam.d/sudo | |
echo "Successfully set." | |
exit 0 | |
else | |
echo "Error: Insufficient privileges, rerun with sudo." | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment