Genereer een key pair:
[username@fromhost ~]$ ssh-keygen -t dsa Generating public/private dsa key pair. Enter file in which to save the key (/home/username/.ssh/id_dsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /home/username/.ssh/id_dsa. Your public key has been saved in /home/username/.ssh/id_dsa.pub. The key fingerprint is: 75:ed:f7:06:00:02:65:3e:4d:7b:fb:cf:4c:59:fc:63 username@fromhost
Kopieer public key naar de remote host:
[username@fromhost ~]$ scp .ssh/id_dsa.pub username@tohost:/home/username/ Password: id_dsa.pub 100% 1131 1.1KB/s 00:00
Voeg de public key toe aan de lijst met geauthorizeerde keys:
username@tohost$ cat id_dsa.pub >> .ssh/authorized_keys
Zorg dat je .ssh directory en de lijst met keys niet world-readable zijn:
username@tohost$ chmod 600 .ssh/authorized_keys username@tohost$ chmod 700 .ssh