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



