ubuntu ssh无密钥登陆

论坛 期权论坛 脚本     
匿名技术用户   2020-12-30 02:22   11   0

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 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:7942463
帖子:1588486
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP