[root@localhost sbin]# 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:
88:8d:6d:2e:fb:a4:ff:a4:17:32:5e:6b:bc:c3:c0:1e root@localhost.localdomain
The key's randomart image is:
+--[ RSA 2048]----+
| |
| |
| |
| = . |
| o.= S |
| oE o |
| .ooO.o |
| =ooB |
| oo++oo |
+-----------------+
[root@localhost sbin]# cd ~/.ssh
[root@localhost .ssh]# ls
id_rsa id_rsa.pub known_hosts
[root@localhost .ssh]# cat id_rsa.pub >> ~/.ssh/authorized_keys
[root@localhost .ssh]# ssh localhost
Last login: Wed Jan 7 15:57:16 2015 from localhost
[root@localhost ~]# exit
logout
Connection to localhost closed.
阅读(514) | 评论(0) | 转发(0) |