出錯:The authenticity of host 'andry (113.12.83.4)' can't be established
下面提供去除該提示的方法。
1. 使用ssh連接遠程主機時加上“-o StrictHostKeyChecking=no”的選項,如下:
ssh -o StrictHostKeyChecking=no 192.168.xxx.xxx
2. 一個徹底去掉這個提示的方法是,修改/etc/ssh/ssh_config文件(或$HOME/.ssh/config)中的配置,添加如下兩行配置:
StrictHostKeyChecking no
UserKnownHostsFile /dev/null
修改好配置後,重新啓動sshd服務即可,命令爲:/etc/init.d/sshd restart (或 service sshd restart )
當然,這是內網中非常信任的服務器之間的ssh連接,所以不考慮安全問題,就直接去掉了主機密鑰(host key)的檢查。
ssh中遇到的“Host key verification failed.”問題,也是和“StrictHostKeyChecking”配置有關。