[root@kvm3 ~]# 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 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: 01:be:06:3d:89:bd:5b:b4:7a:e6:37:b0:07:44:86:35 root@kvm3.deyu.wang The key's randomart image is: +--[ RSA 2048]----+ | .oE | | =.oo. | | o *oo | | . =.o | | +.S | | . +o | | o o+ | | +. + | | .o . | +-----------------+
[root@kvm3 ~]# ssh-copy-id 192.168.122.7 The authenticity of host '192.168.122.7 (192.168.122.7)' can't be established. ECDSA key fingerprint is 30:b2:6e:89:45:69:cc:2f:52:a2:c7:d0:dc:2b:aa:e9. Are you sure you want to continue connecting (yes/no)? yes /usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed /usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys root@192.168.122.7's password: Number of key(s) added: 1 Now try logging into the machine, with: "ssh '192.168.122.7'" and check to make sure that only the key(s) you wanted were added.
[root@kvm3 ~]# ssh 192.168.122.7 Last login: Thu Feb 15 11:58:57 2018 from deyu.wang [root@kvm7 ~]#