解决linux中ssh登录Warning:Permanently added (RSA) to the list of known hosts

原因:

在执行scp id_rsa.pub root@hostname:/root/.ssh这一步时,没在本机的/root/.ssh下生成known_hosts文件。

 

解决方案:

vi /etc/ssh/ssh_config

最后有两行是

         StrictHostKeyChecking no

         UserKnownHostsFile /dev/null

把这两行注释掉并保存文件

再次执行scp id_rsa.pub root@host141:/root/.ssh

出现提示

The authenticity of host 'host141 (172.20.0.141)' can't be established.

RSA key fingerprint is a0:09:89:d2:3b:aa:91:60:59:7f:7f:bc:03:31:b0:09.

Are you sure you want to continue connecting (yes/no)? 

输入yes后,则可看到在/root/.ssh目录下生成了known_hosts文件:

[root@SamuluIndex .ssh]# ls

id_rsa  id_rsa.pub  known_hosts

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值