scp拷貝失敗:Host key verification failed 的處理方法


問題描述:

tc125-dtm{ha2}[35]: scp aa 210.10.3.86:/tmp
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    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
bf:8b:cc:58:71:b0:b4:b1:7b:db:30:92:8f:e7:14:25.
Please contact your system administrator.
Add correct host key in /home/h-a2/vl/home/.ssh/known_hosts to get rid of this message.
Offending key in /home/h-a2/vl/home/.ssh/known_hosts:1
RSA host key for 210.10.3.86 has changed and you have requested strict checking.
Host key verification failed.
lost connection

由於公鑰不一樣了,所以無法登錄,提示信息是 KEY 驗證失敗。

########################################################################

 

解決方法:

1. .ssh/known_hosts 裡面記錄的目標主機 key 值不正確。這是最普遍的情況,只要刪除對應的主機記錄就能恢復正常。

運行命令: sudo rm /home/yourname/.ssh/known_hosts 

2. .ssh 目錄或者 .ssh/known_hosts 對當前用戶的權限設置不正確。這種情況比較少,一般正確設置讀寫權限以后也能恢復正常。

3. /dev/tty 對 other 用戶沒有放開讀寫權限。這種情況極為罕見。出現的現象是,只有 root 用戶能夠使用 ssh client,而所有其他的普通用戶都會出現錯誤。


免責聲明!

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



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