2007-06-29

Ubuntu 7.04下的know_hosts

Ubuntu 7.04下的位于~/.ssh/的文件know_hosts与原来的版本和其他的GNU/Linux发行版本有所不同了。以前的版本能够看出一台远程主机对应的钥值。每一行为一个主机的标识值,分别是:
主机名 IP地址 钥匙类型 钥值
如:
urts96,136.199.199.96 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAIEAwZMisKXEF2poSc WEujP+YLWKl53p80SpOVyp/h3UVxeAVHkLP0s1NkiW5mRlN4prUpxK5UuZ7yd5u9uc/2qMvK 38S2hC4P/aYki7rM8L+fHQPnjiLe+J0j/UfSvUjjPyOeXuSokWWHN8aatvlJQavvZOC36Hd8 In/NtwpzganJc=
当一台server重新装操作系统有新的钥匙值之后,从原来保存有旧的钥匙值的主机上登录这台server时,就会得到警告提示:
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
dd:c4:44:74:80:f7:6b:99:4d:f1:c4:cd:df:65:3a:73.
Please contact your system administrator.
Add correct host key in /home/jiad4701/.ssh/known_hosts to get rid of this message.
Offending key in /home/jiad4701/.ssh/known_hosts:9
RSA host key for germa93 has changed and you have requested strict checking.
Host key verification failed.
lost connection
以前我的解决办法是在客户端的know_hosts文件中删除server对应的钥值。可是如果你的客户端是Ubuntu 7.04,你不能从这个文件中分辨出你要登录的server的钥值在第几行,只能全部删除文件里面的内容。

1 条评论:

  1. 发现警告提示里出现的:
    Offending key in /home/jiad4701/.ssh/known_hosts:9
    很有用。这表明远程主机的对应项在known_hosts文件的第9行。删除文件的第9行即可。

    回复删除