您的位置:首页 > 大数据 > 人工智能

多次删建虚拟机导致ost key verification failed如何解决?删掉kown_host

2017-02-26 15:54 567 查看
hadoop@xuwei-laptop:~$ ssh slave
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for slave has changed,
and the key for the corresponding IP address 192.168.0.42
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/hadoop/.ssh/known_hosts:9
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
e1:e0:28:39:6d:fb:d6:45:72:71:c1:ec:3d:ef:78:19.
Please contact your system administrator.
Add correct host key in /home/hadoop/.ssh/known_hosts to get rid of this message.
Offending key in /home/hadoop/.ssh/known_hosts:5
RSA host key for slave has changed and you have requested strict checking.
Host key verification failed.
错误原因是因为我修改过slave节点。就是第一次我ssh slave节点的ip是192.168.0.10,而第二次的时候slave的ip变为了192.168.0.50.这个时候我在使用ssh
slave命令就会出现上述错误。

3.问题解释
用OpenSSH的人都知ssh会把你每个你访问过计算机的公钥(public key)都记录在~/.ssh/known_hosts。当下次访问相同计算机时,OpenSSH会核对公钥。如果公钥不同,OpenSSH会发出警告,避免你受到DNS
Hijack之类的攻击。因此我们现在只需要删除knows_hosts文件中所对应的slave节点的公钥,然后再ssh slave就可以了。我们使用命令

sudo gedit known_hosts
打开known_hosts,但是我们发现文件内的内容根本找不到slave,文件内容如下
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: