我最近安装了一台新服务器,但现在无法在机器上使用 ssh

我最近安装了一台新服务器,但现在无法在机器上使用 ssh

我安装了一个新的服务器,但现在我无法从我的 Ubuntu 9.04 机器 ssh 进入服务器。我收到以下错误

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Please contact your system administrator.
Add correct host key in /home/myname/.ssh/known_hosts to get rid of this message.
Offending key in /home/myname/.ssh/known_hosts:29
RSA host key for 10.x.x.1 has changed and you have requested strict checking.
Host key verification failed.

我以前从未遇到过这样的问题

答案1

看起来计算机的 RSA 安全密钥已被泄露或更改,这在新安装时通常会出现。您需要在本地计算机上从 known_hosts 文件中删除此计算机,然后尝试连接。这会要求您生成新的 SSH 密钥。

您可以使用 vi 直接编辑该文件。

vi /home/myname/.ssh/known_hosts

答案2

您的服务器上的 SSH 密钥已更改,这就是您的 SSH 客户端提示您存在潜在风险并且不允许您连接的原因。

您最近是否重新安装了机器或服务器上的 SSH?或者您是否重新生成了 SSH 密码?真的有人入侵了? 没关系,您需要做的第一件事就是先访问机器,然后才能了解更多信息。

为此,您需要转到客户端并删除 known_hosts 文件。

rm ~/.ssh/known_hosts

这样做应该没问题,下次连接时,客户端将重新生成一个新的known_hosts文件。

答案3

您是否尝试执行消息所假设的操作?尝试从/home/myname/.ssh/known_host第 29 行删除旧服务器记录。

相关内容