scp命令報錯(IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!)


使用scp命令移動某一服務器的文件到另外的服務器時報出一下錯誤:

[root@bogon vm_sys1]# scp project.tar.gz root@172.31.0.90:/webdata/
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
00:76:4d:f0:26:a3:05:1e:d6:fd:e7:56:32:32:77:41.
Please contact your system administrator.
Add correct host key in /root/.ssh/known_hosts to get rid of this message.
Offending key in /root/.ssh/known_hosts:8
RSA host key for 172.31.0.90 has changed and you have requested strict checking.
Host key verification failed.
lost connection

仔細分析了一下大概是因為172.31.0.90的主機密鑰改了,而本機使用的還是原來的公鑰與其匹配,因此會出現錯誤。有人問不是我們使用密碼么,嗯,原因是這樣,一旦使用本機ssh連接過目標機,則會在~/.ssh/know_hosts文件下生成目標機的公鑰,以便下次可以直接使用。所以,我們可以把該文件下172.31.0.90對應的公鑰刪除掉

vi ~/.ssh/know_hosts

刪除掉172.31.0.90那一行。


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM