ssh登陸提示"Host key verification failed."的解決方

來源:互聯網
上載者:User

ssh登陸提示"Host key verification failed."的解決方案 1、在某些情況下,如同個IP地址,不同連接埠連到不同linux機子上時,可能有此提示 2、報錯資訊如下:    @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@    @    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    23:00:20:83:de:02:95:f1:e3:34:be:57:3f:cf:2c:e7.    Please contact your system administrator.    Add correct host key in /home/xahria/.ssh/known_hosts to get rid of this message.    Offending key in /home/xahria/.ssh/known_hosts:8    RSA host key for localhost has changed and you have requested strict checking.    Host key verification failed.  3、用OpenSSH的人都知ssh會把你每個你訪問過電腦的公開金鑰(public key)都記錄在~/.ssh/known_hosts。當下次訪問相同電腦時,OpenSSH會核對公開金鑰。如果公開金鑰不同,OpenSSH會發出警告,避免你受到DNS Hijack之類的攻擊。  4、在.ssh/config(或者/etc/ssh/ssh_config)中的配置項StrictHostKeyChecking:    預設是ask:如果串連和key不匹配,給出提示,並拒絕登入,預設是被注釋掉的。    yes:如果串連與key不匹配,就拒絕串連,不會提示。    no:如果串連的key在本地不存在,那麼就自動添加到檔案中(預設是known_hosts),並且給出一個警告,可以串連成功。  5、為了防止出現警告提示,且解決同個IP不同連接埠串連,可選擇性地降低安全性,如下配置:    vi /etc/ssh/ssh_config       StrictHostKeyChecking no    UserKnownHostsFile /dev/null #將knownhostfile設為/dev/null,就不儲存在known_hosts中了

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.