garyrust

I switched to Linode - it's easier than Installing on AWS

Nov 2nd, 2020 (edited)
15,144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. # https://vilros.com/products/raspberry-pi-4-power-supply-set-of-4-heatsinks
  2. # I switched to Linode - it's easier - http://173.255.221.168/dokuwiki/doku.php?id=start
  3.  
  4. https://askubuntu.com/questions/1167691/passwordless-login-with-yubikey-5-nfc
  5. How to enable passwordless login
  6.  
  7. Although you should be careful, the process is easy and straightforward. To make it even easier, I've written this so you can simply cut and paste the following commands into a terminal:
  8.  
  9. 1> sudo apt install libpam-u2f pamu2fcfg
  10. 2> pamu2fcfg | sudo tee /etc/u2f_mappings
  11.  
  12. # (At this point, press the button. You should see a long string of numbers. If you don't, make sure you have udev setup correctly.)
  13.  
  14. 3> sudo -i
  15.  
  16. 4> cd /etc/pam.d
  17.  
  18. 5> echo 'auth sufficient pam_u2f.so authfile=/etc/u2f_mappings cue' > common-u2f
  19.  
  20. 6> for f in gdm-password lightdm sudo login; do
  21. mv $f $f~
  22. awk '/@include common-auth/ {print "@include common-u2f"}; {print}' $f~ > $f
  23. done
  24.  
  25. 7> exit
  26.  
  27. Notes
  28.  
  29. When logging in, you'll be prompted to touch your device if it is detected Otherwise, you'll be asked to type in a password.
  30.  
  31. We use the term "sufficient" above so that either the password or the U2F key are sufficient to login (as requested in the question). For a more typical Two-factor Authentication login, "sufficient" would be replaced by the word "required" so that both would always be needed.
  32.  
  33. The u2f line in the pam.d files must come before @include common-auth, otherwise you'll be required to type in a password before the U2F key is checked.
  34.  
  35. I would be remiss if I didn't point out that using a "2FA" key in this way, while convenient, does not increase your security. In fact, you've only opened a second way to get into your account. But, that's not necessarily bad; not everybody needs high-security and a dongle like this can save you from having an easy to type, short, and vulnerable password.
  36.  
  37. And so much more!
  38.  
  39. By the way, these instructions aren't just for devices from Yubico. I'm using a key from Solokeys and it works great. Additionally, the setup works for both USB and NFC keys.
  40.  
  41. If you need more information, Yubico's instructions — as mentioned in the original question — are fairly informative. Also, see the man pages for pam_u2f and pamu2fcfg.
Add Comment
Please, Sign In to add comment