与新域相关的SSH错误

Mas*_*ood 13 ssh ssh-keys

我已经能够ssh正确连接到服务器了.但最近在更改服务器固定IP地址和域名后,我无法通过DNS名称连接到服务器.尽管如此,我可以ssh使用其IP地址到服务器.ssh域名的错误如下:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@       WARNING: POSSIBLE DNS SPOOFING DETECTED!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
The DSA host key for example.com has changed,
and the key for the corresponding IP address X.X.X.X
has a different value. 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/.ssh/known_hosts:10
  remove with: ssh-keygen -f "/home/.ssh/known_hosts" -R X.X.X.X
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 a host key has just been changed.
The fingerprint for the DSA key sent by the remote host is
*:*:*:*:*:....
Please contact your system administrator.
Add correct host key in /home/.ssh/known_hosts to get rid of this message.
Offending DSA key in /home/.ssh/known_hosts:11
  remove with: ssh-keygen -f "/home/.ssh/known_hosts" -R example.com
DSA host key for example.com has changed and you have requested strict checking.
Host key verification failed.
Run Code Online (Sandbox Code Playgroud)

dam*_*ois 24

答案在于问题:

ssh-keygen -f "/home/.ssh/known_hosts" -R example.com
Run Code Online (Sandbox Code Playgroud)

您将获得有关大消息的第一个谷歌点击的更多信息.WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!

  • 非常题外话,但是,这封邮件到底是谁写的?这发生在我的终端和 iTerm 中。真的很像中间人……我在等待他的攻击 (2认同)

Ale*_*xKh 5

您应该从 known_hosts 中删除第 10 行,因为系统会向您发出信号,告知 /home/.ssh/known_hosts:10 中 IP 的冒犯密钥问题

  • 这个对我有用。因为,使用其他命令我收到消息: do_known_hosts: hostkeys_foreach failed: No such file or directory 。谢谢 (2认同)