ubuntu ssh无密钥登陆

来源:互联网 发布:李小龙力量数据 编辑:程序博客网 时间:2024/05/24 06:05

1.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:
bb:e6:a8:89:1c:2f:79:71:68:6d:42:1a:9c:29:f4:18 root@cao-work
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
| E               |
|..+o             |
|..=..            |
| . + o  S        |
|  . = +  .       |
|  .o =  .        |
| .o+.. ...       |
|  oo+..oo        |
+-----------------+

2.scp /root/.ssh/id_rsa.pub root@192.168.0.49:/root/.ssh/authorized_keys

3.ssh root@192.168.0.49

0 0
原创粉丝点击