当我们使用ssh第一次连接一个主机时总是会弹出一个询问,如下:
Are you sure you want to continue connecting (yes/no)?
有时候会影响脚本或剧本执行,如果不想再出现该询问消息,可以在配置文件/etc/ssh/ssh_config
中关掉该设置
vim /etc/ssh/ssh_config
将文件中的StrictHostKeyChecking ask
修改为StrictHostKeyChecking no
,保存退出后重启ssh服务
systemctl restart sshd
再连接就不会询问了