2010-06-22 xiao H Posted in 系统管理
服务器搬家后系统重装过了,所以opensshd 的公钥也变了,而客户机上的公钥还没有更新所以会出如下状况。
[hew@localhost ~]$ ssh hew@linuxsky.org @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: POSSIBLE DNS SPOOFING DETECTED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ The RSA host key for linuxsky.org has changed, and the key for the according IP address 203.171.237.x is unchanged. This could either mean that DNS SPOOFING is happening or the IP address for the host and its host key have changed at the same time. Offending key for IP in /home/hew/.ssh/known_hosts:5 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that the RSA host key has just been changed. The fingerprint for the RSA key sent by the remote host is 46:bc:0a:4e:80:a7:6f:73:b9:73:71:51:a4:52:59:x. Please contact your system administrator. Add correct host key in /home/hew/.ssh/known_hosts to get rid of this message. Offending key in /home/hew/.ssh/known_hosts:6 RSA host key for linuxsky.org has changed and you have requested strict checking. Host key verification failed.
ssh会你每个你访问过的计算机的公钥(public key)都记录在~/.ssh/known_hosts。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告, 避免你受到DNS Hijack之类的攻击。所以当服务器公钥改变而我还在用老的公钥时系统就给了你如上的提示。
解决办法:
实用ssh-keygen -R 释放
[hew@localhost ~]$ ssh-keygen -R linuxsky.org /home/hew/.ssh/known_hosts updated. Original contents retained as /home/hew/.ssh/known_hosts.old [hew@localhost ~]$ ssh hew@linuxsky.org The authenticity of host 'linuxsky.org (203.171.237.x)' can't be established. RSA key fingerprint is 46:bc:0a:4e:80:a7:6f:73:b9:73:71:51:a4:52:59:x. Are you sure you want to continue connecting (yes/no)?
除特别声明外,本站作品皆为原创并以知识共享署名-相同方式共享 3.0 许可协议进行许可。
转载请注明 作者:xiao H,出处:linuxbyte.org ,原始链接:ssh server 公钥改变后客户端无法登录的解决办法
还没有任何评论。
我来说两句