sudo auth with Touch ID and tmux
If you want iTerm to allow sudo authentication to work with Touch ID, follow these steps.
- First, with iTerm you must Turn off
Prefs > Advanced > Allow sessions to survive logging out and back in
- Next, run:
brew install pam-reattach
- Run the following command to find the path to
pam_reattach.so
:find -L /usr/ /opt/ -name "pam_reattach.so" 2>/dev/null | grep -i "homebrew/lib/pam/"
- Then you need to
sudo nano /etc/pam.d/sudo
and add the 2 highlighted lines below. Note the homebrew install pam_reattach.so path you retrieved in the previous step. You’ll need the full path because it is not in PATH by default- Save the file and exit.
- Kill all tmux sessions and restart iTerm2.
- Now when you run
sudo ls
you should be able to use TouchID, instead of typing your password, to authenticate
Finally, fix up iTerm2 so you can use option + arrow
to jump between words in the terminal:
https://superuser.com/questions/427163/altarrow-moving-between-words-in-zsh-and-iterm2
- In iTerm2, go to Preferences > Profile > Keys
- Under the list of Key Mappings there is a box to add/remove or load Presets (combo box)
- Select the
Natural Text Editing
option in the Presets drop down.
Categories: Tech
Comments (0)
Trackbacks (0)
Leave a comment
Trackback