SSH 登录失败:Host key verification failed 的处理方法

 今天在安装过DenyHosts-2.6过后,发现我ssh连接不到linux主机,

提示:

ssh_exchange_identification: Connection closed by remote host

于是换了另外一台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
23:00:20:83:de:02:95:f1:e3:34:be:57:3f:cf:2c:e7.
Please contact your system administrator.
Add correct host key in /home/xahria/.ssh/known_hosts to get rid of this message.
Offending key in /home/xahria/.ssh/known_hosts:8
RSA host key for localhost has changed and you have requested strict checking.
Host key verification failed

有可能你会认为是DenyHosts-2.6影响的,如果你没有对DenyHosts-2.6下面的文件修改过,默认情况下是可以SSH连接上去的

此类问题的解决办法是:

vi ~/.ssh/known_hosts 

192.168.20.220 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA7pKeGGO9Bw3cRxY8X0ErTU5s

+367qHmWp8Ob3ebHwUcq2Gtm47Mpt3wAyDLKTMqnMP2LtP7vvieI66aJ7z

9MPzNGRotYWEGGqcpEAyHjEFmfsKfoiH23+ZuSUXEh0QnmuPgtBz+0Mp6hjMBek

WX9tf6cK4GO0Oje4U6oJp7CGLE1WeaJJZEOLh6L4dwMb7aTVt87cfarwEICqqNrsCX

eZGCBZHqYzdu/GDpm3rZWtQugWu+bk86xyefesjV4GKAbD+azFTOqRPzZ/oiPJDnoiU

iWJYiCingj+KIkOqyUlvGTnMpj8rDr7XgJAnI0Zt9KAr5Y6SA3Jd+oM05TdviNLw==

删除与想要连接的主机相关的行;或者直接删除known_hosts这个文件,都是可以的

之后再从新连接下,即可

你可能感兴趣的:(error,ssh,职场,休闲)