解决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 首次连接提示验证部分。

转载于:https://www.cnblogs.com/zbbiex/p/8931320.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值