2014-11-04 96 views
-2

嗨在過去的幾個星期裏,我使用SSH協議從家裏連接到我的PC。今天,當我想連接到我的電腦就顯示此消息:爲什麼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 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,這裏是輸出:

[email protected]:~$ ssh -v [email protected] 
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 
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password 
Permission denied, please try again. 
[email protected]'s password: 
Mdebug1: Authentications that can continue: publickey,password 
Permission denied, please try again. 
[email protected]'s password: 
debug1: Authentications that can continue: publickey,password 
debug1: No more authentication methods to try. 
Permission denied (publickey,password). 
[email protected]:~$ 

我以爲有人必須更改密碼!所以我今天去了我的辦公室,當我連接筆記本電腦到我的電腦時,它也顯示了第一條信息,但唯一的區別是上述所有解決方案都適用於我,並且在那裏我可以使用舊密碼連接到我的電腦!

我認爲問題已解決,但當我回家時,第一條消息仍然出現,當我刪除known_hosts文件它告訴我密碼是錯誤的,我敢肯定它不是!

因此,似乎我可以連接到我的電腦在我的辦公室,但不在我家! 我確定辦公室和家裏都沒有網絡修改。我仍然不知道該怎麼做!過去幾周我沒有這個問題!

回答

2

我建議您從家裏連接到的IP地址是(現在)是錯誤的。

你運行了ssh命令,它告訴你這個問題:你正在連接到另一臺機器。你忽略了這個建議並刪除了ssh關於機器的知識,然後連接並告訴另一臺機器你的密碼。

然後你在工作中連接,哪個(可能)去了正確的機器(但ssh認爲它是錯誤的),你讓ssh再次忘記,它工作。

您應該:

  1. 修復要連接到的IP地址(也許DHCP外部更改?)。
  2. 更改密碼,因爲您已將它提供給某個未知服務器。
+0

謝謝你,你的意思是「ssh [email protected]」去另一臺機器?!我認爲這是不可能的!如果是這樣,爲什麼PC不會抱怨重複的IP地址?以及爲什麼它問我用戶的密碼,如果它在另一臺計算機上?!用戶「ivan」僅駐留在我的PC中,而不在其他任何地方 – Dimitry 2014-11-04 16:01:12

+0

我不知道您的網絡有足夠的細節來回答第一個問題,但DHCP可以定期重新分配地址。對於第二個問題:在請求密碼之前,SSH不驗證用戶名 - 否則只需通過用不同的用戶名嘗試ssh就可以很容易地找到機器上的有效用戶。 – 2014-11-04 16:35:00

+0

10. *是私人IP範圍,所以我不確定您的網絡是如何設置的,以允許您從家庭網絡訪問您的工作機器。 – 2014-11-04 16:36:00

相關問題