Skip to content

Instantly share code, notes, and snippets.

@zzh1996
Created July 5, 2020 07:59
Show Gist options
  • Save zzh1996/434df3c17f65e5f2222c7eb39eb648b3 to your computer and use it in GitHub Desktop.
Save zzh1996/434df3c17f65e5f2222c7eb39eb648b3 to your computer and use it in GitHub Desktop.
Enable sudo with Touch ID on macOS
#!/bin/bash
set -e
set -x
set -u
set -o pipefail
f="/etc/pam.d/sudo"
/bin/cat "$f" | /usr/bin/grep pam_tid && exit
/bin/chmod +w "$f"
/usr/bin/sed -i '' '2i\'$'\n''auth sufficient pam_tid.so'$'\n' "$f"
/bin/chmod -w "$f"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment