Le but de cet article est très simple, je souhaite que l’userA de ma machineA souhaite se connecter à la machineB en tant que userB sans tapper de mot de passe.
On va donc utiliser l’authentification par clé. Il peut y avoir certaines modifications à apporter au fichier de configuration de ssh, mais j’en ai pas eu besoin sur les distributions testées (Ubuntu, Debian…)
En tant que userA sur la machineA, il faut exécuter les commandes suivantes :
ssh-keygen -t dsa -b 1024 # Permet de générer la clé d'authentification ssh ssh-copy-id -i ~/.ssh/id_dsa userB@machineB # Met en place la clé |
Voici quelques liens pour avoir plus d’info :
http://www.delafond.org/traducmanfr/man/man1/ssh-keygen.1.html
http://www.delafond.org/traducmanfr/man/man1/ssh-copy-id.1.html
http://drpixel.tuxfamily.org/index.php?2006/07/09/10-ssh-authentification-par-cle
1 réflexion au sujet de « Authentification SSH par clé »