Apple Touch ID with sudo in macOS

If you like to integrate Touch ID in sudo, you can do this easily in macOS and use the fingerprint.

Integration in sudo

Just edit the /private/etc/pam.d/sudo file and put a line inside.

Put the following information inside:

The file should look like:

Testing

To test the integration, just echo with sudo.

sudo with Touch ID

Update: If you are using iTerm2:

Turn off Prefs > Advanced > Allow sessions to survive logging out and back in.