Authentification SSH multi-facteur avec OATH (OTP / HOTP) et clés publiques SSH
Aller à la navigation
Aller à la recherche
apt install libpam-oath oathtool
Générez un secret hexadécimal
$ head -10 /dev/urandom | sha512sum | cut -b 1-16 234197a7d5ef5c16
/etc/users.oath :
# Option User Prefix Seed HOTP/T30/6 user - 234197a7d5ef5c16
Sécurisez l'accès aux clés secrètes :
chmod 600 /etc/users.oath chown root:root /etc/users.oath
To enable oath for a specific service only, like ssh, you can edit the file /etc/pam.d/sshd and add at the beginning of the file the following line:
Pour activer l'authentification oath pour ssh, ajoutez cette ligne au début du fichier /etc/pam.d/sshd
:
auth required pam_oath.so usersfile=/etc/users.oath window=30 digits=6
Puis désactivez l'authentification par password unix en commentant la ligne @include common-auth
:
#@include common-auth