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"
}

"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的更多相关文章

  1. ansible报错Using a SSH password instead of a key is not possible because Host Key checking is enabled and sshpass does not support this

    安装和配置好ansible,执行命令时报错如下 [root@test01 ansible-install]# ansible test -m shell -a 'w' >> Using a ...

  2. 【转载】What is the difference between authorized_keys and known_hosts file for SSH?

    The known_hosts file lets the client authenticate the server, to check that it isn't connecting to a ...

  3. Add correct host key in /root/.ssh/known_hosts to get rid of this message

    bug: Add correct host key in /root/.ssh/known_hosts to get rid of this message 解决办法: rm ~/.ssh/known ...

  4. 登录ssh时Host key verification failed错误

    工作中总是测试不同的路由设备, 路由器的ip都是 192.168.111.1 ,ssh登录的时候总是出现这个错误. macos上,错误如下 spawn ssh -p 22 root@192.168.1 ...

  5. ssh远程登录出现Host key verification failed.解决办法

    今天通过ssh和域名连接主机: IcarusdeMacBook-Pro:~ icarus$ ssh root@icarusyu.me 出现了如下错误: @@@@@@@@@@@@@@@@@@@@@@@@ ...

  6. 解决ssh登录Host key verification failed

    使用SSH登录某台机器,有时因为server端的一些变动,会出现以下信息: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @    WARNING: R ...

  7. SSH登录失败:Host key verification failed

    转载自:https://help.aliyun.com/knowledge_detail/41471.html 注意:本文相关 Linux 配置及说明已在 CentOS 6.5 64 位操作系统中进行 ...

  8. SSH连接时出现Host key verification failed的原因及解决方法

    SSH连接的时候Host key verification failed. [root@cache001 swftools-0.9.0]# ssh 192.168.1.90@@@@@@@@@@@@@@ ...

  9. ssh无密码登录设置方法以及出现问题 ECDSA host key 和IP地址对应的key不同的解决

    最近在做hadoop,因为要求各主机之间的用户必须相同,且为方便远程登录,需配置无密码登录 先附上ssh无密码登录设置方法: 先生成密钥并配置无ssh无密码登录本机,输入命令: ssh-keygen ...

随机推荐

  1. arcgis api for flex 开发入门

    参考:http://blog.sina.com.cn/s/articlelist_2346836525_1_1.html 参考教程:https://www.jb51.net/books/81280.h ...

  2. FCN的理解

    FCN特点 1.卷积化 即是将普通的分类网络丢弃全连接层,换上对应的卷积层即可 2.上采样 方法是双线性上采样差 此处的上采样即是反卷积3.因为如果将全卷积之后的结果直接上采样得到的结果是很粗糙的,所 ...

  3. bat运行时自己隐藏黑框,而不是用vbs来调用自己

    //autoStart.bat @echo off if "%1" == "h" goto begin mshta vbscript:createobject( ...

  4. MyBatis基础入门《十五》ResultMap子元素(collection)

    MyBatis基础入门<十五>ResultMap子元素(collection) 描述: 见<MyBatis基础入门<十四>ResultMap子元素(association ...

  5. tp5 auth权限设置

    案例:把所需要的auth类放在一个公共的地方引用,我这里就只是放在了与application同级的extend里面的org所以我在公共控制器里面实例为use \org\Auth; 然后我再公共控制器里 ...

  6. 【Spring学习笔记-MVC】Spring MVC之多文件上传 (zhan)

    http://www.cnblogs.com/ssslinppp/p/4607330.html (zhan)

  7. URL Resources

    Prezi 1. 官网   https://prezi.com/ 2. 入门教程   https://wenku.baidu.com/view/9bb234ac0029bd64783e2c6b.htm ...

  8. 16. 3Sum Closest(双指针)

    Given an array nums of n integers and an integer target, find three integers in nums such that the s ...

  9. cmd下 mysql操作命令大全详解

    启动:net start mySql; 进入:mysql -u root -p/mysql -h localhost -u root -p databaseName; 列出数据库:show datab ...

  10. html5-css渐变应用小实例,按钮

    .but1{    padding: 10px 20px;    font-size: 16px;    text-shadow: 2px 2px 3px rgba(0,0,0,0.8);    bo ...