服务器免密钥登录设置:
[root@192_168_77_189 ~]# ssh-keygen
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> Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
95:cf:19:a5:ff:d0:bc:80:f5:de:5a:4c:b5:63:ae:c6 root@192_168_77_189
The key's randomart image is:
+--[ RSA 2048]----+
| . |
| . o |
| o o. .|
| . oo+.oo|
| S .+.o=+|
| ==+|
| . +=|
| E.o |
| ... |
+-----------------+
[root@192_168_77_189 ~]# ssh-copy-id -i /root/.ssh/id_rsa.pub 192.168.77.190
root@192.168.77.190's password:
Now try logging into the machine, with "ssh '192.168.77.190'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@192_168_77_189 ~]# ssh 192.168.77.190
Last login: Sun Jul 5 23:16:20 2015 from 192.168.77.100
[root@192_168_77_190 ~]# clear
[root@192_168_77_190 ~]#
[root@192_168_77_190 ~]#
[root@192_168_77_190 ~]# exit