Sudo via Touch ID on the Mac

A couple of years ago, I wrote about using Touch ID to enable sudo on the Mac. Someone just posted a link to the original article on Six Colors. It turns out to be incredibly simple—a single line added to the sudo file—and I really did mean to enable it but I didn’t add it to my TODO log so of course I forgot about it. The new mention reminded me and this time I added it before I had a chance to forget. I’m happy to report that it works fine (I’m running the current version of Monterey).

None of this would be worth writing about again—especially since it’s Mac specific—except that I tried it out with Emacs. First I used it from a vterm session and it worked just as you’d expect. Then I tried reopening the sudo file with Ctrl+x Ctrl+f /sudo::/etc/pam.d/sudo and, again, it popped up the dialog telling me to use Touch ID or enter my password.

Since, as many of you know, I’m a bit paranoid about security, I have a long and complicated password on my laptop so having to enter it is a bit of a pain. Using Touch ID instead is a real win for me. If you’re a Mac user—especially a Mac Emacs user—you should spend the 30 seconds it takes to enable Touch ID. You won’t be sorry.

This entry was posted in General and tagged , . Bookmark the permalink.