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.ddirectory - you will find asudo_local.templatefile 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.templateCopy the
sudo_local.templatefile to a new file calledsudo_localand uncomment theauth sufficient pam_tid.soline.sudo cp sudo_local.template sudo_local sudo -e sudo_localThe 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.soThat’s it. From now on, you can use Touch ID to approve
sudocommands. Create a new terminal session and give it a try.