zhangp专栏

关于IT那些事

SSH Warning: the RSA host key for differs from the key for the IP address

[hudson@sjbude183v .ssh]$ ssh soa@sjisbe381 ls /tmp
The authenticity of host 'sjisbe381 (10.100.87.11)' can't be established.
RSA key fingerprint is 8f:bd:9b:06:92:1d:0b:6e:0e:d0:f3:d1:cd:f7:f7:6e.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'sjisbe381' (RSA) to the list of known hosts.
Warning: the RSA host key for 'sjisbe381' differs from the key for the IP address '10.100.87.11'
Offending key for IP in /builds/hudson/.ssh/known_hosts:36
Are you sure you want to continue connecting (yes/no)? 

当ssh访问一台server时,如果出现“Warning: the RSA host key for differs from the key for the IP address”这样的信息,表示在known_hosts里已经有一台server和你正要访问的server的IP冲突。

另外一条类似于这样的信息“Offending key for IP in /builds/hudson/.ssh/known_hosts:36″,表示IP冲突位于known_hosts的第36行, 只要打开~/.ssh/known_hosts,删除第36行就可以将问题解决,或者直接运行一条命令搞定“sed -i -e ’36d’ ~/.ssh/known_hosts”。

如果你想彻底摆脱known_hosts,将“StrictHostKeyChecking no”添加到~/.ssh/config,这样以后访问新的server都不在有known_hosts的提示。





阅读更多
个人分类: Linux
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

加入CSDN,享受更精准的内容推荐,与500万程序员共同成长!
关闭
关闭