-
-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add installation one-liner with explanation
- Loading branch information
1 parent
21fd45e
commit cdb8609
Showing
1 changed file
with
46 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,53 @@ | ||
<div align="center"> | ||
|
||
# sudo-touchid | ||
Automate adding TouchID as sufficient sudo auth method | ||
Automate adding **TouchID** as sufficient sudo auth method <sup>for macOS</sup> | ||
|
||
</div> | ||
|
||
## Try it (without installing!) | ||
## Try it out | ||
|
||
```powershell | ||
curl -sL raw.githubusercontent.com/artginzburg/sudo-touchid/main/sudo-touchid.sh | sh | ||
``` | ||
|
||
> After running this command, you should be able to use TouchID for sudo in Terminal or whatever you're on | ||
> After that you should be able to use TouchID for sudo in Terminal or whatever you're on | ||
## Install | ||
|
||
```powershell | ||
curl -# https://raw.githubusercontent.com/artginzburg/sudo-touchid/main/sudo-touchid.sh -o /usr/local/bin/sudo-touchid && chmod +x /usr/local/bin/sudo-touchid && sudo curl -# https://raw.githubusercontent.com/artginzburg/sudo-touchid/main/com.user.sudo-touchid.plist -o /Library/LaunchDaemons/com.user.sudo-touchid.plist && /usr/local/bin/sudo-touchid | ||
``` | ||
|
||
> The one-liner above cares about everything outlined below for you — so that on a new system the desired feature is just one command away. | ||
<br /> | ||
|
||
## What does it do? | ||
|
||
`sudo-touchid.sh`: | ||
|
||
- Adds `auth sufficient pam_tid.so` to the top of `/etc/pam.d/sudo` file (following [@cabel's advice](https://twitter.com/cabel/status/931292107372838912)) | ||
|
||
- Creates a backup file named `sudo.bak`. | ||
|
||
`com.user.sudo-touchid.plist`: | ||
|
||
- Runs `sudo-touchid.sh` on system reload | ||
|
||
> Needed because any following macOS updates just wipe out our custom `sudo`. | ||
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). | ||
|
||
<br /> | ||
|
||
### Manual installation | ||
|
||
1. Generally follow the steps provided by "The installer" above | ||
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. |