zoukankan      html  css  js  c++  java
  • "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 ma

    Centos7.5 ansible第一次使用模块报错

    问题:

    [root@m01 ~]# ansible webservers -m ping -i ./hosts
    172.16.1.7 | FAILED! => {
        "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."
    }
    172.16.1.8 | FAILED! => {
        "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@m01 ~]# ssh 172.16.1.7
    The authenticity of host '172.16.1.7 (172.16.1.7)' can't be established.
    ECDSA key fingerprint is SHA256:KS0T63CVc6vyFB3MHXLjPGCuTL3AIaNR5Jk1D92pW8Q.
    ECDSA key fingerprint is MD5:5e:6e:7e:90:16:0c:0e:c3:a2:3d:73:2a:9a:be:40:aa.
    Are you sure you want to continue connecting (yes/no)? yes
    root@172.16.1.7's password: 输入密码
    Last login: Tue Feb 26 15:58:50 2019 from 10.0.0.1
    [root@web01 ~]# exit
    logout
    Connection to 172.16.1.7 closed.
    [root@m01 ~]# ansible web01 -m ping -i ./hosts	
    172.16.1.7 | SUCCESS => {
        "changed": false, 
        "ping": "pong"
    }
    

    那如果机器特别多少的情况下怎么办?

    仅需开启ansible中的 host_key_checking = False
    [root@m01 ~]# vim /etc/ansible/ansible.cfg 
    host_key_checking = False
    [root@m01 ~]# ansible webservers -m ping -i ./hosts
    172.16.1.7 | SUCCESS => {
        "changed": false, 
        "ping": "pong"
    }
    172.16.1.8 | SUCCESS => {
        "changed": false, 
        "ping": "pong"
    }
  • 相关阅读:
    SAP Cloud for Customer Sales Lead明细页面视图的UI模型
    如何基于SAP CDS view创建OData服务
    使用SAP HANA Web-based Development工具进行SQLScript练习
    SAP ABAP守护进程(ABAP Daemon)的实现方式
    使用SAP云平台Mobile Service开发移动应用
    SAP CRM WebClient UI Excel Export的运行时执行明细
    MySQL里面的子查询实例
    hash_hmac 签名
    redis单例模式写法
    jQuery 短信验证码倒计时
  • 原文地址:https://www.cnblogs.com/lvhanzhi/p/10438785.html
Copyright © 2011-2022 走看看