Time to upgrade! Get an iPhone 12 mini + Unlimited Data for $60/mo

  • Forums
  • Shop
  • CES 2021
  • iPhone 12
  • Best VPN
  • iOS 14
  • Nintendo Switch
  • AirPods Pro

We may earn a commission for purchases using our links. Learn more.

Sudo use my fingerprint

How to use sudo with Touch ID on your Mac

Use Terminal often? This tip from Cabel Sasser could help speed up your workflow.
Serenity Caldwell
17 Nov 2017

Here's a tip from Cabel Sasser of Panic for those of you out there with Touch Bar MacBook Pros who use Terminal and the "sudo" command frequently.

Pro MacBook Pro Tip: have a Touch Bar with Touch ID? If you edit /etc/pam.d/sudo and add the following line to the top…

auth sufficient pam_tid.so

…you can now use your fingerprint to sudo!

— Cabel Sasser (@cabel) November 16, 2017

Here's the full step-by-step, for those who want to experiment. That said: sudo is an incredibly powerful command in the Terminal; we don't recommend messing around with this trick if you don't feel comfortable working in the Terminal app and changing system preference files.

VPN Deals: Lifetime license for $16, monthly plans at $1 & more

Want to learn Terminal? Here are 15 commands we think every user should know.

Also worth noting, via Sasser:

(Important caveat/warning: if you SSH into that machine, you will NOT be able to sudo, as your fingerprint cannot travel through SSH. 😜)

— Cabel Sasser (@cabel) November 16, 2017

How to enable Touch ID for sudo commands on your MacBook Pro with Touch Bar

  1. In Safari, paste the following into the search bar: file:///etc/pam.d/sudo.

    Alternatively, you can edit the file within the Terminal app itself using command-line text editors like emacs or nano; if you choose to do this, go to step 8, and skip steps 10-12.

  2. Press Command-I with the sudo file highlighted to open up the information screen.

  3. Click on the Lock icon in the bottom right corner.
  4. Enter your authentication information (or use Touch ID).
  5. Change the privileges of all users to Read & Write.

  6. Download TextWrangler, a free plain text editor, or use the plain text editor of your choice.
  7. Open the sudo file in TextWrangler (or equivalent).
  8. Paste auth sufficient pam_tid.so on line 2 of the document (underneath the initial comment line)

    Note: If you get a note about the document being locked, go back to step 2-5 and make sure you've enabled Read & Write privileges on the document.

  9. Save the sudo file and close it.

  10. In Finder, press Command-I with the sudo file highlighted to open up the information screen.
  11. Change the privileges on all users to Read only.
  12. Click on the Lock icon in the bottom right corner.

Now, when you open Terminal and attempt a sudo command, you should be prompted with a Touch ID authentication in lieu of entering your administrator password.

Questions?

Let us know below.

We may earn a commission for purchases using our links. Learn more.

Apple still can't keep up with iPhone 12 Pro demand
hot cakes

Apple still can't keep up with iPhone 12 Pro demand

Morgan Stanley's Katy Huberty says that Apple has slashed 2M iPhone 12 mini units so it can try to keep up with iPhone 12 Pro demand.

Linux now 'completely usable' on M1 Mac mini
Linux

Linux now 'completely usable' on M1 Mac mini

Corellium's Chris Wade says Linux is now "completely usable" on the M1 Mac mini when booting from a USB stick.

Apple could announce first-ever $100B quarter at January earnings call
$$$

Apple could announce first-ever $100B quarter at January earnings call

Multiple reports note that Apple could announce its first-ever quarter with $100 billion sales.

Get your clickity clack on with the best mechanical keyboards for Mac!
Click Clack

Get your clickity clack on with the best mechanical keyboards for Mac!

Apple's Magic Keyboard is great for a lot of people, but some folks like to feel and hear every keystroke, which is why mechanical keyboards will always maintain some popularity.

Keep in Touch

Sign up now to get the latest news, deals & more from iMore!

I would like to receive news and offers from other Future brands.

I would like to receive mail from Future partners.

No spam, we promise. You can unsubscribe at any time and we'll never share your details without your permission.

  • Help & How To
  • Developer Tools

Serenity Caldwell

Serenity was formerly the Managing Editor at iMore, and now works for Apple. She's been talking, writing about, and tinkering with Apple products since she was old enough to double-click. In her spare time, she sketches, sings, and in her secret superhero life, plays roller derby. Follow her on Twitter @settern.

  • iPhone
  • iPad
  • Apple Watch
  • Apple TV
  • Mac
  • Reviews
  • How To
  • HomeKit
  • Forums

Other Categories

  • About Us
  • Newsletter
  • Fitness
  • Apps
  • Gaming
  • Deals
  • Advertising Inquiries
  • Licensing and Reprints
  • Accessibility Statement
  • Android Central
  • Windows Central
  • CrackBerry
  • Thrifter
  • TechnoBuffalo
  • MrMobile
Log in or Sign up
  • t
  • f
  • y
  • i
  • r

Brightness

  • © Future US, Inc.
  • Terms & Conditions
  • Privacy Policy
  • Cookie Policy
  • Careers
  • Licensing
  • External Links Disclosure
  • Accessibility Statement
  • © Future US, Inc.
  • Terms & Conditions
  • Privacy Policy
  • Cookie Policy
  • Careers
  • Licensing
  • External Links Disclosure
  • Accessibility Statement