首页 > 系统服务 > 详细

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

时间:2015-09-25 18:07:25      阅读:35343      评论:1      收藏:0      [点我收藏+]

标签:style   log   it   la   sp   文件   ha   for   ca   

远程登录==>

[root@i-nbje0lea .ssh]# ssh 192.168.9.10
Warning: Permanently added ‘192.168.9.10‘ (RSA) to the list of known hosts.
Last login: Fri Sep 25 15:37:49 2015 from 192.168.9.11

Warning:Permanently added (RSA) to the list of known hosts错误

因:在执行ssh 时,没在本机的~/.ssh下生成known_hosts文件。

解决方案:
# vi/etc/ssh/ssh_config         //注意是客户端设置文件
最后有两行是
        StrictHostKeyChecking no             #登录时是否询问
        UserKnownHostsFile /dev/null     #表示隐藏known_hosts文件

两行解释如下:

StrictHostKeyChecking

If this flag is set to “yes”, ssh(1) will never automatically add host keys to the
             ~/.ssh/known_hosts file, and refuses to connect to hosts whose host key has changed.The default is “ask”.

UserKnownHostsFile
             Specifies a file to use for the user host key database instead of ~/.ssh/known_hosts.
把这两行注释掉并保存文件
再次执行ssh 192.168.9.10
出现提示

[admin@i-nbje0lea .ssh]$ ssh 192.168.9.10
The authenticity of host ‘192.168.9.10 (192.168.9.10)‘ can‘t be established.
RSA key fingerprint is 50:e9:44:87:86:c3:0f:85:ab:41:5e:33:1e:5b:6a:c1.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘192.168.9.10‘ (RSA) to the list of known hosts.
Last login: Fri Sep 25 15:27:34 2015 from 192.168.9.11

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


[root@host100.ssh]# ls
id_rsa  id_rsa.pub  known_hosts

 

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

标签:style   log   it   la   sp   文件   ha   for   ca   

原文:http://www.cnblogs.com/itcomputer/p/4838548.html

(3)
(3)
   
举报
评论 一句话评论(1
2017-09-01 14:23:45
拓源优课项目管理系统:www.toyoke.com
回复
 (0)
 (0)
1条  
登录后才能评论!
© 2014 bubuko.com 版权所有 鲁ICP备09046678号-4
打开技术之扣,分享程序人生!
             

鲁公网安备 37021202000002号