YubiKey Security Key für Linux Login und „sudo“ Befehle einrichten.

YubiKey Manager

Zuerst den Yubikey mit dem „Yubikey Manager“ initialisieren.

https://askubuntu.com/questions/1167691/passwordless-login-with-yubikey-5-nfc

Dann den Ubikey im Linux bekannt machen und für die verschiedenen Auth Verfahren in /etc/pam.d einrichten.

Läuft bei mir mit MX Linux als Dualboot auf einem Mac Book Pro 2015

How to enable passwordless login

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:

Software installieren

sudo apt install libpam-u2f

Den public key für jeden Ubikey als aktueller User erzeugen und in Datei schreiben.

pamu2fcfg | sudo tee -a /etc/u2f_mappings

Jetzt sollte der Yubikey blinken.

Die Kontaktfläche berühren.

Der private key ist zu sehen und wird gleichzeitig in die Datei „/etc/u2f_mappings“ geschrieben.

Gegebenenfalls kontrollieren.

cat /etc/u2f_mappings


sudo -i
echo >> /etc/u2f_mappings
cd /etc/pam.d

echo 'auth sufficient pam_u2f.so authfile=/etc/u2f_mappings cue' > common-u2f

for f in $(grep -l "@include common-auth" *); do
  if [[ $f == *~ ]]; then continue; fi
  if grep -q "@include common-u2f" $f; then continue; fi
  mv $f $f~
  awk '/@include common-auth/ {print "@include common-u2f"}; {print}' $f~ > $f
done

exit

Schreibe einen Kommentar