您现在的位置是:首页 > 正文

切换域名后,ssh配置问题

2024-04-01 05:03:36阅读 1

OS: CentOS release 6.10 (Final)

问题:今天在在gp迁移测试时,把GP备份的域名从A机迁移到了B机。 

配置后,发现使用ssh 命令登录到需要同步文件到GP备机时,发现失败,提示信息如下:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The RSA host key for gp69.db has changed,
and the key for the according IP address 10.7.10.12
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/dwetl/.sshown_hosts:62
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
a7:51:02:ba:b1:73:77:ee:59:89:19:be:54:3a:7a:a0.
Please contact your system administrator.
Add correct host key in /home/dwetl/.sshown_hosts to get rid of this message.
Offending key in /home/dwetl/.sshown_hosts:64
RSA host key for gp69.db has changed and you have requested strict checking.

 

#问题原因:由于切换域名的原因,之前的主机对应的信任列表,已经在know_hosts文件中。

 而在访问相同域名对应的新主机时,发现可信任列表与新的公钥匹配不上,于是报错。

 

解决方法:在know_hosts中,把之前的互信列表中的主机信息删除,使用ssh协议登录域名对应的新主机后,会在know_hosts文件中重新写入新的互信信息。

网站文章