macOS: How to Enable Touch ID Authentication for Sudo in Terminal

macOS terminal icon

A few days ago, a commenter in The Mac Observer‘s Mac Geek Gab Forum shared a way to use the sudo command in Terminal and use Touch ID authentication. With the default set up you have to type in your log in password for the admin account to use the command.

Sudo With Touch ID

First, commenter penguintopia says we must create a shell script:

if [[ `grep tid /etc/pam.d/sudo` ]]
echo "TouchID already enabled"
sed -i '' '1 a\
auth sufficient\
' /etc/pam.d/sudo
echo "Enabling TouchID for sudo";

Next, make the shell script executable:

chmod +x /usr/local/bin/

Finally, add this command to crontab with crontab -e:

@reboot /usr/local/bin/

This will preserve any changes Apple makes.

Notify of

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Comment
Oldest Most Voted
Inline Feedbacks
View all comments

Crontab on macOS on 2021? hmm…