Code: Alles auswählen
server1:~# ssh-keygen -t dsa
Code: Alles auswählen
Generating public/private dsa key pair.
Enter file in which to save the key (/root/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_dsa.
Your public key has been saved in /root/.ssh/id_dsa.pub.
The key fingerprint is:
be:8f:b7:19:7d:5f:17:e6:2b:a8:8f:b7:35:1d:7a:11 root@server1
Code: Alles auswählen
server1:~# ssh-copy-id -i .ssh/id_dsa.pub server2.maennchen1.de
Code: Alles auswählen
The authenticity of host 'server2.maennchen1.de (192.168.1.10)' can't be established.
RSA key fingerprint is e1:7b:c5:14:a8:e2:dc:0a:92:ef:cc:48:65:07:c7:24.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'server2.maennchen1.de,192.168.1.10' (RSA) to the list of known hosts.
Password:
Now try logging into the machine, with "ssh 'server2.maennchen1.de'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
Jetzt kann man ohne Passwort-Abfrage connecten:
Code: Alles auswählen
server1:~# ssh server2.maennchen1.de