sudo with Touch ID in macOS Sonoma
Enabling Touch ID for sudo
commands hasn’t changed much since at least Big Sur - with the introduction of macOS Sonoma, Apple
made it even easier to make it a persistent setting.
Follow these steps, and you’re done:
Switch into the
/etc/pam.d
directory - you will find asudo_local.template
file there.$ cd /etc/pam.d $ ls -l sudo* .r--r--r-- 283 root 16 Sep 15:28 sudo .r--r--r-- 179 root 16 Sep 15:28 sudo_local.template
Copy the
sudo_local.template
file to a new file calledsudo_local
and uncomment theauth sufficient pam_tid.so
line.sudo cp sudo_local.template sudo_local sudo -e sudo_local
The file should look like the following:
# sudo_local: local config file which survives system update and is included for sudo # uncomment following line to enable Touch ID for sudo auth sufficient pam_tid.so
That’s it. From now on, you can use Touch ID to approve
sudo
commands. Create a new terminal session and give it a try.