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. Oracle推进SCN系列:使用oradebug在mount状态下推进SCN

    环境:RHEL 6.5(x86-64) + Oracle 11.2.0.4 声明:推进SCN属于非常规恢复范畴,不建议非专业人员操作,否则后果自负. 需求:我这里演示下推进SCN 10W数量级,实际需 ...

  2. mybatis之注解式开发

    注解: 注解是用于描述代码的代码.例如:@Test(用于描述方法进行junit测试),@Override(用于描述方法的重写),@Param(用于描述属性的名称) 注解的使用风格:@xxx(属性),使 ...

  3. ES6之字符串扩展

    ES6字符串新增的常用方法: 1. includes(): 字符串中是否包含某个字符或字符串, 包含的两个字符必须是相连的 let str = 'hello, world' str.includes( ...

  4. Javascript-do_while....

    <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8&quo ...

  5. Oracle / PLSQL函数 - DECODE

    1.DECODE( expression , search , result [, search , result]... [, default] ) 参数说明: expression : 表中的某一 ...

  6. redis 知识点

    默认端口  6379 单个value 最大可以保存1G 默认RDB(异步刷盘方式) 禁用持久化修改redis.conf,找到save配置,改为save "" 即可 1. 特点 Re ...

  7. Java多线程-----匿名内部类创建线程

       1.继承Thread类创建线程 package com.practise.createthread; public class AnonymousThread { public static v ...

  8. Chess (SG + 状态压缩预处理)

    #include<bits/stdc++.h> #define bit(t) (1 << t) using namespace std; <<; ;//k是集合s的 ...

  9. IO多路复用 IO异步

    一.概念说明 同步IO和异步IO,阻塞IO和非阻塞IO分别是什么,到底有什么区别?不同的人在不同的环境给出的答案是不同的.所以先限定一下本文的环境.本文讨论的背景是Linux环境下的network I ...

  10. 转:C# 小数位数保留的方法集锦

    转载自:http://www.jb51.net/article/17010.htm 1. System.Globalization.NumberFormatInfo provider = new Sy ...