码迷,mamicode.com
首页 > 系统相关 > 详细

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

时间:2015-09-25 18:10:27      阅读:288      评论:0      收藏:0      [点我收藏+]

标签:

远程登录==>

[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

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!