
通過(guò)SSH或SFTP連接時(shí)遇到問(wèn)題?如果您收到如下所示的錯(cuò)誤,這通常是因?yàn)镮P地址或SSH密鑰指紋已更改(通常是由于服務(wù)器更新),而舊的仍存儲(chǔ)在您的known_hosts文件中,該文件用于SSH和SFTP連接。
[user@hostname ~]$ ssh root@user @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 RSA key sent by the remote host is xx:xx:xx. Please contact your system administrator. Add correct host key in /home/hostname /.ssh/known_hosts to get rid of this message. Offending RSA key in /var/lib/sss/pubconf/known_hosts:4 RSA host key for user has changed and you have requested strict checking. Host key verification failed.
如果您在連接時(shí)遇到問(wèn)題,請(qǐng)首先確保您使用的是正確的密碼。
如果仍有問(wèn)題,請(qǐng)按照以下說(shuō)明從known_hosts文件中刪除條目。
- 從Mac或Linux上的known_hosts文件中刪除條目
- 從Windows上的known_hosts文件中刪除條目
Mac或Linux
1.打開(kāi)終端并使用nano文本編輯器編輯以下文件。
nano ~/.ssh/known_hosts
2.刪除所有以您的服務(wù)器IP地址開(kāi)頭的條目。
3.然后保存文檔 (Ctrl+x)。
Windows
如果您使用的是Windows,它也有一個(gè)類(lèi)似的known_hosts文件,但憑據(jù)和IP存儲(chǔ)在注冊(cè)表中。
1.從開(kāi)始菜單啟動(dòng)regedit。下面的示例使用的是Windows 10。

Windows注冊(cè)表編輯器
2.瀏覽到以下目錄:HKEY_CURRENT_USERSoftWareSimonTathamPuTTYSshHostKeys

3.刪除所有以您的服務(wù)器IP地址結(jié)尾的條目。




















