Last active
September 14, 2020 08:59
-
-
Save schneefisch/02ac1d1a7995da4bdc90fbb08c07a09d to your computer and use it in GitHub Desktop.
How to setup Yubikey login protection on Ubuntu
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
#!/bin/bash | |
# how to configure Ubuntu, see: | |
# https://support.yubico.com/support/solutions/articles/15000011355-ubuntu-linux-login-guide-challenge-response | |
# configure a yubikey | |
ykman otp chalresp -g 2 | |
# associate a yubikey with your account | |
ykpamcfg -2 | |
# ------------ | |
# other way | |
sudo apt install libpam-u2f | |
mkdir ~/.config/Yubico | |
pamu2fcfg > ~/.config/Yubico/u2f_keys | |
# for additional keys run | |
pamu2fcfg -n >> ~/.config/Yubico/u2f_keys | |
# configure system to use U2F keys | |
sudo nano /etc/pam.d/sudo | |
# Add the line below after the “@include common-auth” line. | |
auth required pam_u2f.so | |
# configure system to use U2F keys for login | |
sudo nano /etc/pam.d/gdm-password | |
# Add the line below after the “@include common-auth” line. | |
auth required pam_u2f.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment