提示警告信息如下:
arnold@WSN:~$ ssh 10.18.46.111
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ 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
08:98:a9:cc:f8:37:20:6b:b4:b1:6c:3a:15:b9:a9:92.
Please contact your system administrator.
Add correct host key in /home/arnold/.ssh/known_hosts to get rid of this message.
Offending key in /home/arnold/.ssh/known_hosts:2
RSA host key for 10.18.46.111 has changed and you have requested strict checking.
Host key verification failed.
原因分析:
It is also possible that a host key has just been changed.
我之前對ssh服務器重裝了系統,導致所有與原系統建立過ssh連接的系統都無法再建立連接,因為在於原系統建立首次連接時,雙方相互記錄了對方的公鑰(ssh基於非對稱密鑰技術),在ssh服務主機重裝系統后,公鑰改變了,任以舊版本公鑰的主機自然是無法與新系統連接的。
網上還有分析為ssh主機被人黑了,並在消除入侵記錄時對known_hosts文件做了改動。當然也不排除這種可能,但我估計我是沒那個福氣了:)
解決方案:
刪除~/.ssh/known_hosts文件,或者如果你可以判斷出known_hosts中原ssh服務器的公鑰,刪去那部分,
然后后再次建立新的連接,即可獲得新的公鑰。