[root@about01 ~]# 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:
0d:c5:77:58:6e:13:d2:0f:c7:c0:51:de:7a:52:5d:d2 root@about01
The key's randomart image is:
+--[ RSA 2048]----+
| .. .=**o|
| .. oo=+E|
| . . .++=|
| o . +.|
| S . o .|
| o |
| |
| |
| |
+-----------------+
[root@about01 ~]# ssh-copy-id about01
The authenticity of host 'about01 (192.168.80.201)' can't be established.
RSA key fingerprint is 07:07:8e:1c:c0:7e:7f:1f:ca:6a:e6:d3:cb:7f:b7:a1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'about01,192.168.80.201' (RSA) to the list of known hosts.
root@about01's password:
Now try logging into the machine, with "ssh 'about01'", and check in:
.ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.
[root@about01 ~]# ssh about01
root@about01's password:
Last login: Sun Feb 8 17:39:46 2015 from about01
[root@about01 ~]# exit
logout
Connection to about01 closed.
为什么登录还需要密码
|
|