[root@localhost ~]# 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:
bc:fb:11:ed:ea:0e:aa:d6:b4:5c:c7:69:8a:1d:40:18 root@localhost
The key's randomart image is:
+--[ RSA 2048]----+
| Eo |
| . . |
| . |
| .. . |
| .S.... |
| . o.=o |
| + =o=. . |
| . =.oo o |
| .... .+= |
+-----------------+
步骤2: 用 ssh-copy-id 把公钥复制到远程主机上
ligh@local-host$ ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.0.3
阅读(1231) | 评论(0) | 转发(0) |