Created
February 6, 2019 18:02
-
-
Save lichti/a245b9a1113ea826bf5b073df4f79e7d to your computer and use it in GitHub Desktop.
Script to configure yubikey as a 2FA in linux login
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
# Script to configure yubikey as a 2FA in linux login | |
# Distro Ubuntu 18.04 | |
# Install pam module | |
sudo apt install libpam-u2f | |
# Register device for user | |
pamu2fcfg -u<user> | sudo tee -a /etc/u2f_mappings | |
# Cofigure yubike as required to login | |
sudo sed -i '/# here/a auth required pam_u2f.so authfile=/etc/u2f_mappings cue' /etc/pam.d/common-auth | |
# Cofigure yubike as sufficient to sudo | |
sudo sed -i 's/.*common-auth.*/auth sufficient pam_u2f.so authfile=\/etc\/u2f_mappings cue\n&/' /etc/pam.d/sudo | |
#sudo reboot |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment