Skip to content

Instantly share code, notes, and snippets.

@Hendrik44
Created December 7, 2018 09:37
Show Gist options
  • Save Hendrik44/0b81fd2c9a84e929417be06a07f00ad2 to your computer and use it in GitHub Desktop.
Save Hendrik44/0b81fd2c9a84e929417be06a07f00ad2 to your computer and use it in GitHub Desktop.
Activate Touchid on OSX to use for sudo in terminal
set -e
if grep -xq "pam_tid.so" /etc/pam.d/sudo; then
echo "Option to use touchid for sudo already installed :)"
else
echo "Configure to use Touchid for sudo ..."
sudo chmod 644 /etc/pam.d/sudo # change permission to have write access
sudo cp /etc/pam.d/sudo /etc/pam.d/sudo.org # make a copy of original file
echo 'auth sufficient pam_tid.so' | cat - /etc/pam.d/sudo > sudo && mv sudo /etc/pam.d/sudo # append file
sudo chmod 444 /etc/pam.d/sudo # change permission back
echo "Touchid for sudo successfully configured. A copy of the original file you will find here: /etc/pam.d/sudo.org"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment