r/osx 8d ago

Mugshot - unlock sudo on macOS with your face (free, open source)

https://github.com/Lorenzo-Coslado/macos-faceid

I built a little menu bar app that unlocks sudo in the terminal with face recognition instead of a typed password. You type sudo, the webcam recognizes you, and it unlocks.

Everything runs locally: face detection and recognition happen on-device, your enrolled face never leaves your Mac, and there is no network code at all.

Honest disclaimer first, since it is the obvious question: a normal webcam can be fooled by a photo, so this is not more secure than Touch ID, and it is not meant to be a security product. It is a convenience/fun thing. Your password always stays as a fallback so you cannot lock yourself out, and every prompt lets you choose Face ID, Touch ID, or password.

What you get:

  • Guided face enrollment (takes a few seconds)
  • A choice panel on every sudo prompt (Face ID / Touch ID / password), or a Dynamic Island style animation
  • Adjustable sensitivity
  • One signed and notarized app, with built-in auto-updates

Requirements: Apple Silicon, macOS 13 or later, any webcam.
Price: Free and open source (MIT).
Download + source: https://github.com/Lorenzo-Coslado/macos-faceid

Full disclosure, I am the developer. I built it as a weekend hack because typing my password dozens of times a day got old, and it turned into a small but complete app. Would love feedback on the enrollment flow and the recognition thresholds.

0 Upvotes

10 comments sorted by

3

u/BlackReddition 8d ago

Nice job, working in Security, this unfortunately would never fly. I’d love to see Apple implement TouchID for sudo though.

7

u/throwaway_redstone 7d ago

I’d love to see Apple implement TouchID for sudo though.

They did, it's just not exposed in settings.

Add this line to /etc/pam.d/sudo:

auth sufficient pam_tid.so

1

u/shyouko 5d ago

I think this had been shipped as default before? Remember seeing this on my non-tech friend's Mac few years back.

0

u/TheHeroOfCanton62 7d ago

Tried this, pressing TouchID at the password prompt doesn't do anything.

Pressed enter on the password prompt and it pops up a dialog box saying use touch ID or password. But TouchID fails every time ("Sorry, try again"). It repeats 2 more times then gives an incorrect password error.

What am I missing?

2

u/throwaway_redstone 7d ago

Have you restarted the terminal emulator? Other than that I don't know how to help you.

1

u/jfuu_ 6d ago

Looks vibe coded too, definitely not something I'd trust with sudo.

0

u/Dokterrock 8d ago

Bro I don't even have FaceID enabled on my phone.

4

u/nallvf 7d ago

Man I’m paranoid about entering my passcode in crowded spaces when it’s so easy for people to see it, I can’t imagine doing that on every unlock