Skip to content

Enable TouchID for sudo in iTerm 2/3

When working in a terminal (iTerm), continuously entering a long secure password can be oppressive. Macbook’s Pro equipped with TouchBar have TouchID this is a fingerprint reader. It’s possible in macOS Catalina (10.15) to use TouchID into sudo operations.

Enabling it’s very easy:

  1. Open in text editor file /etc/pam.d/sudo
    sudo nano /etc/pam.d/sudo
    add (at the top) line:
    auth sufficient pam_tid.so
  2. Go to iTerm (iTerm2 -> Preferences…) – or use shortcut cmd and comma ⌘, im Advanced tab scroll to category Session i change Allow sessions to survive logging out and back in. to No.
Obrazek posiada pusty atrybut alt; plik o nazwie 1.png
iTerm2 -> Preferences…
Obrazek posiada pusty atrybut alt; plik o nazwie 2.png
Setting – Allow sessions to survive logging out and back in.

1 thought on “Enable TouchID for sudo in iTerm 2/3”

  1. Super useful, only wish it persisted after Mac OS updates. I’ve had to add this line back a few times to the file, at least I’m pretty sure the updates are overwriting the file when Mac updates to a new minor version.

Leave a Reply

Your email address will not be published. Required fields are marked *