rhel4-sec主机
[root@rhel4-sec ~]# pwd
/root
[root@rhel4-sec ~]# mkdir .ssh
[root@rhel4-sec ~]# chmod 700 .ssh/
[root@rhel4-sec ~]# cd .ssh/
[root@rhel4-sec .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
de:15:ee:84:2c:dd:60:9c:39:cd:41:a2:e9:b4:e6:2a root@rhel4-sec
[root@rhel4-sec .ssh]# ssh-keygen -t dsa
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:
6b:cb:c8:34:56:9e:0b:e5:06:4d:4b:c1:dc:b8:64:36 root@rhel4-sec
[root@rhel4-sec .ssh]# cat *.pub > authorized_keys
[root@rhel4-sec .ssh]# scp authorized_keys rhel5-2:/root/
rhel5-2 主机
[root@rhel5-2 ~]# pwd
/root
[root@rhel5-2 ~]# mkdir .ssh
[root@rhel5-2 ~]# chmod 700 .ssh/
[root@rhel5-2 ~]# cd .ssh/
[root@rhel5-2 .ssh]# ssh-keygen -t rsa
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
c1:08:5e:0d:43:ad:e1:87:58:5e:0d:14:26:c5:4b:b7 root@rhel5-2
[root@rhel5-2 .ssh]# ssh-keygen -t dsa
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:
2f:de:ed:6f:48:b5:72:7e:93:91:c7:b3:2e:14:5a:e3 root@rhel5-2