(instructions from mietzen)
NOTE: you may need to perform these steps every time you upgrade macOS.
To allow Touch ID on your Mac to authenticate you for sudo access instead of a password you need to do the following.
- Open Terminal
- Switch to the root user with:
sudo -i - Edit
/etc/pam.d/sudo:
nano /etc/pam.d/sudoThe contents of this file should look like this:
# sudo: auth account password session
auth sufficient pam_smartcard.so
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so- You need to add an additional auth line to the top:
auth sufficient pam_tid.so
- So it now looks like this:
# sudo: auth account password session
auth sufficient pam_tid.so
auth sufficient pam_smartcard.so
auth required pam_opendirectory.so
account required pam_permit.so
password required pam_deny.so
session required pam_permit.so-
Save the file with
ctrl oand exit withcrtl x -
Try to use sudo, and you should be prompted to authenticate with Touch ID.
Source: https://apple.stackexchange.com/a/306324/409134
$ brew install bitwarden-cliThis wrapper function around the bw command stores the session key in a file that requires root access to read.
Copy bitwarden.fish to your Fish config directory (eg ~/.config/conf.d) and restart your shell.
$ bw loginNOTE: you will need to re-run this command any time you re-log in
$ bw --regenerate-session-key# Look up a password
$ bw list items --search <search term> | jq --raw-output '.[0].login.password'
# Look up a username
$ bw list items --search <search term> | jq --raw-output '.[0].login.username'mietzenOriginal zsh version https://gist.github.com/mietzen/f383d87c0973c1af877b39e09b50021eOpa-Fish version https://gist.github.com/Opa-/b828995590ca79e653a01c63bbaca64f