SSH鏈接的時候Host key verification failed.html
➜ ~ ssh root@192.168.1.88 @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ 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 ECDSA key sent by the remote host is SHA256:LVUSJyjf2eBfUCcdjg0zKmWpLtk5+uF9OGrXXqcZ4PU. Please contact your system administrator. Add correct host key in /Users/guanbinbin/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /Users/guanbinbin/.ssh/known_hosts:93 ECDSA host key for 192.168.1.88 has changed and you have requested strict checking. Host key verification failed.
StrictHostKeyChecking變量來配置的。默認狀況下,
StrictHostKeyChecking=ask。簡單所下它的三種配置值:
1.
StrictHostKeyChecking=no
#最不安全的級別,固然也沒有那麼多煩人的提示了,相對安全的內網時建議使用。若是鏈接server的key在本地不存在,那麼就自動添加到文件中(默認是known_hosts),而且給出一個警告。
2.
StrictHostKeyChecking=ask #默認的級別,就是出現剛纔的提示了。若是鏈接和key不匹配,給出提示,並拒絕登陸。
3.
StrictHostKeyChecking=yes #
最安全的級別,若是鏈接與key不匹配,就拒絕鏈接,不會提示詳細信息。
對於我來講,在內網的進行的一些測試,爲了方便,選擇最低的安全級別。在.ssh/config(或者/etc/ssh/ssh_config)中配置:安全
StrictHostKeyChecking no UserKnownHostsFile /dev/null
vi ~/.ssh/known_hosts
刪除對應ip的相關rsa信息ssh
rm known_hosts