[[email protected] ~]# ssh-keygen-t RSA # Create key pair
Generating public/private RSA key pair
Enter file in which to save the key (/ROOT/.SSH/ID_RSA):
Created directory '/root/.ssh '.
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:
e0:19:93:d6:0d:fc:3f:7d:fd:b1:67:af:63:bc:d4:67 [email protected]
The key ' s Randomart image is:
+--[RSA 2048]----+
| .. |
| o.o |
| * ... |
| o =. |
| o S. . .|
| O. oo|
| O.. e|
| . +o=|
| . o=+|
+-----------------+
[Email protected] ~]# ssh-copy-id-i ssh/id_rsa.pub [email protected]#Deploying a public key to a KVM server
the authenticity of Host ' 10.0.0.20 (10.0.0.20) ' can ' t be established.
ECDSA key fingerprint is c3:a2:bc:39:7d:a5:fd:f5:8a:93:28:fd:e6:4c:29:7b.
is you sure want to continue connecting (yes/no)? Yes
/usr/bin/ssh-copy-id:info:attempting to log on with th E new key (s), to filter out all that is already installed
/usr/bin/ssh-copy-id:info:1 key (s) remain to be installed --If you're prompted now it's to install the new keys
[email protected] ' s password:
Number of key (s) ad Ded:1
Now try logging into the machine, with: "ssh" [email protected] ' "
and check to make sure That's the key (s) you wanted were added.
[[email protected] ~]# ssh-copy-id-i. ssh/id_rsa.pub [email protected] deploy public key to KVM server
the authenticity of Host ' 10.0.0.30 (10.0.0.30) ' can ' t be established.
ECDSA key fingerprint is c3:a2:bc:39:7d:a5:fd:f5:8a:93:28:fd:e6:4c:29:7b.
is you sure want to continue connecting (yes/no)? Yes
/usr/bin/ssh-copy-id:info:attempting to log on with th E new key (s), to filter out all that is already installed
/usr/bin/ssh-copy-id:info:1 key (s) remain to be installed --If you're prompted now it's to install the new keys
[email protected] ' s password:
Number of key (s) ad Ded:1
Now try logging into the machine, with: "ssh" [email protected] ' "
and check to make sure That's the key (s) you wanted were added.
[[email protected] ~]#
[[email protected] ~]# ssh 10.0.0.20 #测试登陆服务器
Last Login:tue-22:27:43 from controller
[[email protected] ~]# ssh 10.0.0.30 #测试登陆服务器
Last Login:tue-22:28:11 from controller
This article is from the "GSWCFL" blog, make sure to keep this source http://guoshiwei.blog.51cto.com/2802413/1926443
Linux sshssh Password-free authentication