SSH连接主机时出现连接不上的问题


今天想连接一台虚拟机来做实验,输入命令:ssh 192.168.1.101时出现下面的问题
[root@root ~]# ssh 192.168.1.101
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
02:03:df:90:b1:3a:4d:be:b8:f2:83:dc:9f:0e:df:8d.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:2
RSA host key for 192.168.1.101 has changed and you have requested strict checking.
Host key verification failed.
 
在网上查了一下发现是因为以前另一台主机使用过这个IP地址,生成的rsa与本主机不同,所以不能连接,所以就需要把与这个IP地址有关的注册信息删除掉,连接时会重新生成,就可以连接了,即删除掉如下内容
 
192.168.1.101 ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsrkXrOJ7YGOmCO8FWJtbPiU2ezrGcrX8+Drhad4IwebBXxnzu8pA36ph8641P1wZ1Pn+0MQyN5OURNvAFEyKWbYuFOMwFjuAlmWTW6jZPXDbkqautYCyJB1VyMaR1RgN0NuerB1VYP78hhODFVbKDJIm9R5A/ZJ5DTDVqpf6sO/9i2xP++RZRaOrnuZAYH8HJ7j6aBp6p7u4asT/CNgUi/KZTgZAXLk9kIiFxGUvhhKgjDJ7+man4mI+Z5n7awq80NLRV8Dc6gtkKahi+1vs28QxtZntcsHHGTXZdrnrhoVnXHM7Dtk/Ch0RUpSiEYWRknmeWcofrVEXYofX9HxBUw==

相关内容