1. 使用ssh连接远程主机时加上“-o StrictHostKeyChecking=no”的选项,如下:
1 | ssh -o StrictHostKeyChecking=no 192.168.xxx.xxx |
2. 一个彻底去掉这个提示的方法是,修改/etc/ssh/ssh_config文件(或$HOME/.ssh/config)中的配置,添加如下两行配置:
1 2 | StrictHostKeyChecking no UserKnownHostsFile /dev/null |
修改好配置后,重新启动sshd服务即可,命令为:/etc/init.d/sshd restart (或 service sshd restart )