SSH 错误:警告:远程主机标识已更改!

SSH 错误:警告:远程主机标识已更改!

我运行 rsync (cygwin) 并收到此错误。我认为他们昨晚将 Red Hat Linux 操作系统从版本 5 更改为版本 6。这会是此错误消息的原因吗?我需要做什么来解决这个问题?我记得,sysadm 在设置 cygwin 后在我的计算机上运行了一个名为 ssh-keygen 的命令。我是否需要重新运行该文件并将文件复制到 RH6 服务器?

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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 RSA key sent by the remote host is
xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx:xx.
Please contact your system administrator.
Add correct host key in /home/xxxxx/.ssh/known_hosts to get rid of this message.
Offending RSA key in /home/xxxxx/.ssh/known_hosts:2
RSA host key for xxxxx has changed and you have requested strict checking.
Host key verification failed.
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at /home/lapo/package/rsync-3.0.9-1/src/rsync-3.0.9/io.c(605) [Receiver=3.0.9]

答案1

假设您相信主机确实更改了其主机密钥,您可以删除旧条目。因为这个告诉你旧的条目在第 2 行,你可以这样做

sed -i -e '2d' ~/.ssh/known_hosts

从您已知的主机文件中删除旧条目

相关内容