hn.today

You can use Touch ID for sudo

modulovalue.com14 points1 comments
Screenshot of You can use Touch ID for sudo

The piece explains how to replace repeated password entry for macOS sudo commands with Touch ID. Since macOS Sonoma, users can make the update-resistant local PAM configuration by copying `/etc/pam.d/sudo_local.template` to `/etc/pam.d/sudo_local` and enabling the `pam_tid.so` authentication line. With the setting marked “sufficient,” a matching fingerprint authorizes the command; if the prompt is canceled, sudo falls back to the usual password. A new terminal and `sudo -v` provide a quick test.

Apple’s built-in Touch ID module has a limitation: macOS stops showing its prompt during screen capture, including screen sharing, recording, and use of some DisplayLink docks. The author describes a custom PAM module that instead calls Apple’s LocalAuthentication API, continues to work during capture, and displays the requester and full command. It has been used daily on three Macs, with installation instructions and code shared in a skills repository. The piece also suggests pairing Touch ID with carefully chosen `NOPASSWD` sudoers rules so approved commands run without prompts, while warning that powerful tools can effectively grant root access. For tmux, it notes that `pam-reattach` may be needed and advises using `sudo_local` rather than editing the main sudo configuration, which updates can overwrite.

Read on modulovalue.com1 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Security

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.