• Stars
    star
    488
  • Rank 90,182 (Top 2 %)
  • Language
    Shell
  • License
    Eclipse Public Li...
  • Created over 3 years ago
  • Updated about 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

 Permanent TouchID support 👆 for `sudo`.

Icon

sudo-touchid

Downloads Donate

Native and reliable TouchID support for sudo

Try it out     without installing

curl -sL git.io/sudo-touch-id | sh

Now sudo is great, just like Safari — with your fingerprint in Terminal or whatever you're on.

Don't worry, you can also reverse it without installing

Please note: without full installation, TouchID for sudo will be disabled after the next macOS update.

Result:

Preview

Just type git.io/sudotouchid to go here.

Features

  • Fast
  • Reliable
  • Written in Bash — no dependencies!
  • Include it to your automated system build — always working and up to date with major macOS upgrades!

Install

Via 🍺 Homebrew (Recommended)

brew install artginzburg/tap/sudo-touchid
sudo brew services start sudo-touchid

Check out the formula if you're interested

Using curl

curl -sL git.io/sudo-touchid | sh

curl is pre-installed in macOS

Performs automated "manual" installation.


The installation process:

  1. Makes the sudo-touchid command available.
  2. Makes it auto-run on every system launch (using a simple launchd daemon with RunAtLoad key set to true), so that when a macOS update erases our custom sudo configuration, sudo-touchid fixes it again.

Usage

sudo-touchid [options]
           # Running without options adds TouchID parameter to sudo configuration
             [-v,  --version]   # Output installed version
           # Commands:
             [-d,  --disable]   # Removes TouchID from sudo config

if not installed, can be used via curl bundled with macOS

sh <( curl -sL git.io/sudo-touch-id ) [options]
                                    # Reliability — check :)
                                      [-d,  --disable]   # Removes TouchID from sudo config

Why?

  1. Productivity

    macOS updates do reset /etc/pam.d/sudo, so previously users had to manually edit the file after each upgrade.

    This tool was born to automate the process, allowing for TouchID sudo auth to be quickly enabled on a new/clean system.

  2. Spreading the technology.

    I bet half of you didn't know.

    It was there for a long time.

  3. Lightness

    The script is small, doesn't need any builds, doesn't need XCode.

    Code size comparison — previously favoured solution VS. the one you're currently reading:


How does it work?

sudo-touchid.sh — the script:

  • Adds auth sufficient pam_tid.so to the top of /etc/pam.d/sudo file following @cabel's advice

  • Creates a backup file named sudo.bak.

  • Has a --disable (-d) option that performs the opposite of the steps above.

Non-Homebrew files:

com.user.sudo-touchid.plist — the property list (global daemon):

  • Runs sudo-touchid.sh on system reload

    Needed because any following macOS updates just wipe out our custom sudo.

install.sh — the installer:

  • Saves sudo-touchid.sh as /usr/local/bin/sudo-touchid and gives it the permission to execute.

    (yes, that also means you're able to run sudo-touchid from Terminal)

  • Saves com.user.sudo-touchid.plist to /Library/LaunchDaemons/ so that it's running on boot (requires root permission).


Manual installation

  1. Generally follow the steps provided by the installer in "Non-Homebrew files"
  2. If you need to, store sudo-touchid.sh anywhere else and replace /usr/local/bin in com.user.sudo-touchid.plist with the chosen path.

Contributing

PRs and Issues are much welcome!

If you don't like something — change it or inform the ones willing to help.


Related

Disabling password prompt for sudo

  • Change %admin ALL=(ALL) ALL to %admin ALL=(ALL) NOPASSWD: ALL in /etc/sudoers

TouchID support in tmux

Apple Watch TouchID support

More Repositories

1

powerchime

 The missing macOS' PowerChime switcher 🔊
Shell
41
star
2

2FAtoTray

 Copy 2FA tokens in a click (macOS)
JavaScript
16
star
3

macOS-should-ship-with

 A curated list of applications, softwares, tools and shiny things that should come bundled with macOS.
16
star
4

barhide

 Hide unwanted icons from your menu bar
Shell
15
star
5

macOS-Essentials

 Apps and sets that are nice to use
10
star
6

wifi-pass

 QR encode, copy or get the password of current Wi-Fi connection
Shell
7
star
7

stack

Tower stacking game using React Three Fiber (WebGL)
TypeScript
7
star
8

FunctionToggler

 Quickly toggle the fn key behavior (macOS app)
AppleScript
6
star
9

PiPOSS

 Brings Picture in Picture shortcut and custom button to any video.
JavaScript
5
star
10

dotenv-extended-prepare

📦 Auto-creating .env files based on .env.defaults and .env.schema from dotenv-extended
TypeScript
4
star
11

homebrew-tap

 Homebrew 🍺 · Formulas for my coolest tools
Ruby
3
star
12

awesome-stars

⭐ GitHub · Language-sorted list of my stars
3
star
13

css-clamper

📦 Cozy responsive sizes for CSS-in-JS
TypeScript
2
star
14

games-without-js

No client-side JavaScript, relying purely on SSR and CSS. Disable JS in your browser for an immersive experience
TypeScript
2
star
15

form-to-json

Simple Express server that converts HTML forms to JSON and sends them to another endpoint
JavaScript
2
star
16

telegraf-layoutfixer

✈️ Layout fixing middleware for Telegram bots
JavaScript
2
star
17

.github

:octocat: GitHub ⚙️ · Configuration files for all my repositories
1
star
18

artginzburg.github.io

Personal website of Art Ginzburg · https://ginzburg.art
TypeScript
1
star
19

stats-fetcher

Holds my stats fetched from various sources
JavaScript
1
star
20

telegraf-ignore-old-messages

✈️ The crash-preventing middleware for Telegram bots
JavaScript
1
star
21

vscode-settings

💻 My VSC settings — for public access and version control
Makefile
1
star
22

artginzburg

:octocat: GitHub · Profile
TypeScript
1
star
23

flightnotifier

✈️ Telegram bot
JavaScript
1
star
24

yandex.praktikum-portfolio

Ya.Praktikum 🏫 · Project works made during my education at the Web-Development faculty
1
star
25

jun-hackaton-frontend

Team project for https://jun-hackaton-landing.vercel.app
TypeScript
1
star