keepcalculator

06 Numbers and Powers

Touch ID for sudo on Mac: How to Enable It

Card No. 06·75423 · Updated · Standard formula, shown below

Yes, you can use Touch ID to authenticate sudo commands on a Mac running macOS Sequoia or later. This guide explains how to enable it, what to do if it stops working, and how it compares to other authentication methods.

Background: Why sudo Usually Asks for a Password

The sudo command lets you run administrative tasks in the Terminal. By default, macOS requires your account password every time you use sudo, even if you have a Touch ID–equipped Mac. This is a deliberate security choice: sudo is a powerful tool, and requiring a password adds a layer of protection against accidental or malicious changes.

Touch ID was introduced on Macs in 2016, but for years it only unlocked the Mac and authenticated Apple Pay and App Store purchases. It wasn’t until macOS Sequoia (released in 2024) that Apple added native support for using Touch ID with sudo. Before that, users had to rely on third-party tools or manual configuration.

How to Enable Touch ID for sudo

Enabling Touch ID for sudo is a one-time change to a system file. Here are the steps:

  1. Open the Terminal app (found in /Applications/Utilities/).
  2. Type sudo nano /etc/pam.d/sudo and press Enter.
  3. Enter your administrator password when prompted.
  4. Add the following line at the top of the file (before any other lines):
    auth sufficient pam_tid.so
  5. Press Control+O to save, then Control+X to exit.
  6. Close and reopen Terminal, then try a sudo command. Touch ID should appear.

If you use a third-party terminal app like iTerm2, the same file works, but you may need to enable “Allow Full Disk Access” for that app in System Settings → Privacy & Security.

What to Do If Touch ID Stops Working

Touch ID for sudo can stop working after a macOS update or if you change your password. Here are common fixes:

  • Check the PAM file: Open /etc/pam.d/sudo and make sure the auth sufficient pam_tid.so line is still present and at the top.
  • Re-add Touch ID: Go to System Settings → Touch ID & Password, remove your fingerprints, and add them again.
  • Restart the Mac: A simple restart often resolves temporary authentication glitches.
  • Check terminal permissions: For third-party terminals, ensure they have Full Disk Access and are allowed to use Touch ID.

If none of these work, you can still use your password as a fallback—Touch ID is an additional method, not a replacement.

Security Considerations and Limitations

Using Touch ID for sudo is convenient, but it has a few caveats:

  • Fallback to password: If you fail to authenticate with Touch ID three times, macOS falls back to password entry. This is by design.
  • Not for remote sessions: Touch ID does not work over SSH or in a virtual machine, because the sensor is not available in those contexts.
  • Same privileges: Touch ID grants the same sudo privileges as a password, so it does not weaken security if your Mac is physically secure.
  • Biometric data: Your fingerprint is stored in the Secure Enclave, not on Apple’s servers, and is never transmitted.

Some users worry that Touch ID is less secure than a password because someone could force your finger onto the sensor. In practice, this is a minor risk for most people, but you can disable Touch ID for sudo if you are concerned.

Alternatives to Touch ID for sudo

If Touch ID is not available on your Mac, or you prefer other methods, there are alternatives:

  • Password: The default method. Simple and reliable.
  • Apple Watch: On macOS Ventura and later, you can use your Apple Watch to authenticate sudo commands if you enable “Use Apple Watch to unlock apps and your Mac” in System Settings → Touch ID & Password.
  • Third-party tools: Tools like pam_watchid or pam_reattach can provide similar functionality, but they require more setup and may break after updates.

For most users, Touch ID is the easiest and most integrated option, but the Apple Watch method is a good backup if you wear one.

Frequently Asked Questions

Does Touch ID for sudo work on all Macs?

No. Your Mac must have a Touch ID sensor (introduced in 2016) and run macOS Sequoia or later. Older Macs without a sensor cannot use Touch ID at all.

Will this work in iTerm2 or other terminal apps?

Yes, but you may need to grant Full Disk Access to the terminal app. If you still get a password prompt, try using the built-in Terminal app first.

Is it safe to edit the PAM file?

Yes, if you follow the instructions carefully. The change only adds Touch ID as an authentication method; it does not remove password authentication. If something goes wrong, you can remove the line and revert to the default.

Why does sudo still ask for a password after I added the line?

This usually happens because the line was not added at the very top of the file, or because the terminal app does not have the required permissions. Double-check the file and restart Terminal.

Can I use Touch ID for sudo over SSH?

No. Touch ID requires the physical sensor, so it does not work over SSH or in remote sessions. You must use a password or key-based authentication in those cases.

Does Touch ID work after a reboot?

Yes, but you may need to unlock your Mac with your password once after a reboot before Touch ID becomes active. This is a standard security feature.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →