[iyunv@nod2 ~]# ssh-keygen -t rsa -P '' 确保nod2加密连接到nod1
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa):
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:
b0:bc:2e:44:88:6e:7b:a7:d0:63:f6:9f:4f:f8:4d:55 root@nod2.mageedu.com
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| . . . E |
|. . .. o . |
|. . o S . |
| o. . .. . |
|...* .. . . |
| .+.+o + o |
| ..oooo.o . |
+-----------------+[iyunv@nod2 ~]# ssh-copy-id -i .ssh/id_rsa.pub root@nod1The authenticity of host 'nod1 (192.168.1.10)' can't be established.RSA key fingerprint is 41:26:a8:88:6a:93:f6:56:aa:87:6b:d7:62:46:83:0d.Are you sure you want to continue connecting (yes/no)? yesWarning: Permanently added 'nod1,192.168.1.10' (RSA) to the list of known hosts.root@nod1's password: Now try logging into the machine, with "ssh 'root@nod1'", and check in: .ssh/authorized_keys to make sure we haven't added extra keys that you weren't expecting. [iyunv@nod2 ~]# ssh nod1 'date';dateMon Oct 5 17:45:26 HKT 2015Mon Oct 5 17:45:26 HKT 2015