【问题标题】:Why SSH shows this message repeatedly? [closed]为什么 SSH 反复显示此消息? [关闭]
【发布时间】:2014-11-04 19:52:51
【问题描述】:

您好,在过去的几周里,我一直在使用 SSH 协议从家里连接到我的 PC。今天当我想连接到我的电脑时,它显示了这条消息:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
e4:e2:ac:f0:d1:1b:72:56:f0:47:4a:68:95:54:e1:a3.
Please contact your system administrator.
Add correct host key in /home/dimit/.ssh/known_hosts to get rid of this message.
Offending ECDSA key in /home/dimit/.ssh/known_hosts:1
  remove with: ssh-keygen -f "/home/dimit/.ssh/known_hosts" -R 10.136.18.76
DSA host key for 10.136.18.76 has changed and you have requested strict checking.
Host key verification failed.

通过搜索互联网,我意识到这是SSH的常见问题,因此我尝试按照建议的解决方案解决它,例如:

ssh-keygen -R hostname

or

rm .ssh/known_hosts 

....

所以在完成这些解决方案后,消息消失了。但是当我被要求输入密码并且我输入时,它告诉我密码错误!我尝试了所有解决方案,但没有一个对我有用。我使用 -v 选项运行 SSH,输出如下:

dimit@dimit-GE620-GE620DX-FX620DX:~$ ssh -v ivan@10.136.18.76
OpenSSH_5.9p1 Debian-5ubuntu1.4, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 10.136.18.76 [10.136.18.76] port 22.
debug1: Connection established.
debug1: identity file /home/dimit/.ssh/id_rsa type -1
debug1: identity file /home/dimit/.ssh/id_rsa-cert type -1
debug1: identity file /home/dimit/.ssh/id_dsa type -1
debug1: identity file /home/dimit/.ssh/id_dsa-cert type -1
debug1: identity file /home/dimit/.ssh/id_ecdsa type -1
debug1: identity file /home/dimit/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version dropbear_0.51
debug1: no match: dropbear_0.51
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1.4
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: sending SSH2_MSG_KEXDH_INIT
debug1: expecting SSH2_MSG_KEXDH_REPLY
debug1: Server host key: DSA e4:e2:ac:f0:d1:1b:72:56:f0:47:4a:68:95:54:e1:a3
debug1: Host '10.136.18.76' is known and matches the DSA host key.
debug1: Found key in /home/dimit/.ssh/known_hosts:1
debug1: ssh_dss_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/dimit/.ssh/id_rsa
debug1: Trying private key: /home/dimit/.ssh/id_dsa
debug1: Trying private key: /home/dimit/.ssh/id_ecdsa
debug1: Next authentication method: password
ivan@10.136.18.76's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
ivan@10.136.18.76's password: 
Mdebug1: Authentications that can continue: publickey,password
Permission denied, please try again.
ivan@10.136.18.76's password: 
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).
dimit@dimit-GE620-GE620DX-FX620DX:~$ 

我还以为有人改了密码!!!所以我今天去了我的办公室,当我将笔记本电脑连接到我的电脑时,它也显示了第一条消息,但唯一的区别是上述所有解决方案都对我有用,在那里我可以使用旧密码连接到我的电脑!!!

我以为问题解决了,但是当我回到家时,当我删除 known_hosts 文件时,第一条消息仍然出现,它告诉我密码错误,我确定不是!!!!

看来我可以在我的办公室连接到我的电脑,但不能在我的家里! 我确定办公室和我家都没有网络修改。而且我仍然不知道该怎么办!在过去的几周里我没有遇到这个问题!

【问题讨论】:

    标签: linux ssh


    【解决方案1】:

    我建议您从家里连接到的 IP 地址是(现在)错误的。

    您运行了 ssh 命令,它告诉您问题:您正在连接到另一台机器。您忽略了该建议并删除了 ssh 对机器的了解,然后连接并告诉另一台机器您的密码。

    然后你在工作时连接,它(可能)连接到正确的机器(但 ssh 认为它是错误的),你让 ssh 再次忘记它并且它工作。

    你应该:

    1. 修复您要连接的 IP 地址(也许 DHCP 已从外部更改?)。
    2. 更改您的密码,因为您已将其提供给某个未知服务器。

    【讨论】:

    • 谢谢你,你的意思是“ssh ivan@10.136.18.76”转到另一台机器吗?!!我觉得不可能!!!如果是这样,为什么 PC 不抱怨重复的 IP 地址?如果它在另一台计算机上,为什么它会问我用户的密码?!用户“ivan”仅驻留在我的 PC 中,不在其他任何地方
    • 我不了解您的网络的足够详细信息来回答第一个问题,但 DHCP 可以定期重新分配地址。对于第二个问题:SSH 在询问密码之前不会验证用户名 - 否则只需尝试使用不同用户名的 ssh 就很容易找出机器上的有效用户。
    • 10.* 是一个私有 IP 范围,所以我不确定您的网络是如何设置的以允许您从家庭网络访问您的工作计算机。
    • IP 地址是静态 IP,不是由 DHCP 服务器分配的。这就是为什么我确信我的办公室里只有一台机器使用这个 IP 地址。明天我会改密码看看问题是否解决!!!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-09-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-23
    相关资源
    最近更新 更多