解决ansible首次链接host服务器需验证问题

问题描述:服务器

[root@iZm5e79rtwsq2hm57teyk5Z ansible]# ansible aofeng -f 5 -m ping 192.168.1.106 | FAILED! => { "failed": true, "msg": "Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this.  Please add this host's fingerprint to your known_hosts file to manage this host." } [root@iZm5e79rtwsq2hm57teyk5Z ansible]
 缘由:
  当ansible首次去进行ssh链接一个服务器的时候,因为在本机的~/.ssh/known_hosts文件中并有fingerprint key串,ssh第一次链接的时候通常会提示输入yes 进行确认为将key字符串加入到  ~/.ssh/known_hosts 文件中。故回报如上错误。
 
       解决办法:在/etc/ansible/ansible.cfg文件中进行配置;
       在# uncomment this to disable SSH key host checking下

      host_key_checking = False默认是注释掉的  
      打开 host_key_checking = False的注释。一样也能够实现跳过 ssh 首次链接提示验证部分。ssh

相关文章
相关标签/搜索