Génération des clés privées et publiques
machine-locale:$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/login/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/login/.ssh/id_dsa. Your public key has been saved in /home/login/.ssh/id_dsa.pub. The key fingerprint is: 11:ee:bc:47:b0:c8:40:03:4f:a0:09:a4:71:39:93:93 login@machine-locale The key's randomart image is: +--[ DSA 1024]----+ |+.+*+ . | |o=E+ . . . | |+ +o + | | o + + | | o o . | | + | | . . | | . | | | +-----------------+
Transfert du fichier contenant la clé publique sur la machine distante
machine-locale : cat ~/.ssh/id_dsa.pub | ssh login@machine-distante "cat - >> ~/.ssh/authorized_keys"