How To Use Touch ID for SUDO on macOS

VideoZoran Jambor

A hands-on guide to setting up macOS to use Touch ID for sudo—so you don't have to type your password every time manually.

On macOS 14 (Sonoma) and newer, you can use Touch ID for sudo. There is already a template file on your system that you can use to enable this.

Copy the template file /etc/pam.d/sudo_local.template to /etc/pam.d/sudo_local, then edit it and uncomment the specified line to enable Touch ID for sudo.


sudo cp /etc/pam.d/sudo_local.template /etc/pam.d/sudo_local
sudo nano /etc/pam.d/sudo_local

Uncomment the line stated in the file. Once you do, the file should look like this:

# sudo_local: local config file which survives system update and is included fo$
# uncomment following line to enable Touch ID for sudo
auth       sufficient     pam_tid.so

Save the file, and as soon as you open another terminal window, you can use Touch ID for sudo.

Note that this works only on your local machine, so you can't use it if you SSH into a remote server.

There is an additional limitation on macOS where this doesn't work when you're recording the screen — you'll still be asked for your password. However, there is a way to bypass this limitation if you enter this into the terminal nd run it:


defaults write com.apple.security.authorization ignoreArd -bool TRUE`

Links

CSS Weekly YouTube Channel

CSS Weekly YouTube Channel

Weekly hands-on tutorials, tips, tools, news, and more — everything related to CSS and front-end development, created by Zoran Jambor.

Subscribe Today »
CSS Stickers

CSS Stickers

A set of beautiful, cute, and funny CSS stickers to showcase your love for CSS.

Get Your Set Today »