Note: For macOS Ventura and prior, full installation is necessary to preserve TouchID for
sudothrough system updates.
Via 🍺 Homebrew (Recommended)
brew install artginzburg/tap/sudo-touchid
sudo brew services start sudo-touchidCheck out the formula if you're interested
Using curl
curl -sL git.io/sudo-touchid | sh- Adds
auth sufficient pam_tid.soto the top of/etc/pam.d/sudofile (following @cabel's advice). - Creates a backup file named
sudo.bak. - Optional
--with-reattachflag addspam_reattach.sobeforepam_tid.sofor tmux/screen support.
macOS updates reset /etc/pam.d/sudo, so previously users had to manually edit the file after each upgrade. This tool automates the process by:
- Making the
sudo-touchidcommand available. - Auto-running on every system launch using a simple
launchddaemon, so that when a macOS update erases the customsudoconfiguration,sudo-touchidfixes it again.
- Save
sudo-touchid.shas/usr/local/bin/sudo-touchidwith execute permissions - Save
com.user.sudo-touchid.plistto/Library/LaunchDaemons/for auto-run on boot - Customize paths in the
.plistfile if needed