[root@express-balance ~]# 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:
4c:70:f5:87:1b:de:8e:3a:ff:53:d0:bb:a8:1b:8d:75 root@express-balance
The key's randomart image is:
+--[ RSA 2048]----+
| . ... |
| o . . |
| . + .. |
| o . =. .|
| S o..E.|
| +o...|
| o..o..|
| ...... |
| .=+... |
+-----------------+
2.建公约传给需要登录的远程主机
[root@express-balance .ssh]# scp id_rsa.pub root@192.168.35.3:/root/.ssh
Address 192.168.35.3 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
root@192.168.35.3's password:
id_rsa.pub 100% 402 0.4KB/s 00:00
[root@express-balance .ssh]# ssh root@192.168.35.3
Address 192.168.35.3 maps to localhost, but this does not map back to the address - POSSIBLE BREAK-IN ATTEMPT!
Last login: Thu Mar 6 09:56:25 2014 from 192.168.53.106