ansible:Using a SSH password instead of a key is not possible because Host Key checking
问题背景
当设置好ansible的hosts后,尝试用ansible去连接host里设置的主机。
我使用的是162主机去连接163主机:
如果你之前从来没有连接过163主机,执行后会报错
[root@itlaoxin162 ~]# ansible -i /etc/ansible/hosts web-servers -m ping
[WARNING]: Invalid characters were found in group names but not replaced, use -vvvv to
see details
192.168.1.163 | 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."
问题原因
这是因为你控制端和被控制端第一次通信时,需要添加指纹
解决方案
有两种解决方案:
方法1 . 可以直接修改配置文件
vim /etc/ansible/ansible.cfg
中的 host_key_checking = False 的#去掉即可
然后在执行命令
[root@itlaoxin162 ~]# ansible -i /etc/ansible/hosts web-servers -m ping
[WARNING]: Invalid characters were found in group names but not replaced, us
see details
192.168.1.163 | SUCCESS => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "ping": "pong"
}
可以看到已经执行成功了。
方法2:直接登陆SSH,留下指纹即可
使用ssh 登陆远程主机,只要登陆过一次,下次就不会报错。
ansible:Using a SSH password instead of a key is not possible because Host Key checking相关推荐
- Using a SSH password instead of a key is not possible because Host Key checking
运行ansible出错 [root@ansible ~]# ansible webservers -m ping -u root -k SSH password: 192.168.154.130 | ...
- 解决用Xshell工具通过ssh登陆linux操作系统提示找不到匹配的host key算法问题
前几天升级了两台linux服务器的openssh,当时测试两台服务器通过xshell登陆都是正常的.今天通过xshell登陆报找不到匹配的host key算法,如下图所示: 试过https://blo ...
- Git提示: Unable to negotiate with xxx.xxx.xxx.xxx port XX: no matching host key type found.
解决: 前提: 在排除没有配置公钥的情况下. 在Git的安装目录下 Git > etc > ssh 文件夹下找到 ssh_config 文件,在文件末尾添加一下代码 Host *Hostk ...
- Ansible 部署的时候提示错误 SSH password instead
在使用 Ansible 部署的时候提示: fatal: [*.*.*.*]: FAILED! => {"msg": "Using a SSH password in ...
- git拉取代码报错:Unable to negotiate with xxx port xxx: no matching host key type found
git拉取代码报错: Unable to negotiate with 172.18.19.44 port 22: no matching host key type found. Their off ...
- 【已解决】Unable to negotiate with — port 22: no matching host key type found. Their offer: ssh
标题 mac系统,想通过ssh连接,但出现以下报错:Unable to negotiate with 10.188.5.86 port 22: no matching host key type fo ...
- Ansible :一个配置管理和IT自动化工具
========================================================================================== 一.基础介绍 == ...
- SSH-Auditor:一款SSH弱密码探测工具
SSH-Auditor:一款SSH弱密码探测工具 freebuf 2018-09-16 ssh-auditor是一款可帮助你探测所在网络中ssh弱密码的工具. 特性 以下操作ssh-auditor都 ...
- github开发人员在七夕搞事情:remote: Support for password authentication was removed on August 13, 2021.
一. 问题描述 如果你在七夕(没错就是2021年8月14日)的这一天刚好加班,又刚好去访问了全球最大的同性交友网站,又刚好去更新提交代码,又或你创建了一个新的仓库送给自己,又刚好想把这个仓库送给(pu ...
最新文章
- Java项目:仿小米电子产品售卖商城系统(java+SpringBoot+Vue+MySQL+Redis+ElementUI)
- ajax从mysql提取数据在html中_EXCEL混合内容中提取数据,其实很简单
- 多协程实例讲解(四 Python)
- 收款神器!解读聚合收款码背后的原理,你都知道吗?
- 直接请求接口_「软件测试教程」基于postman进行接口测试实战
- Signature字段
- 快速得到容器ID和veth bridge interface的关系
- grep 二进制文件grep AMI 2012-11-23.log Binary file 2012-11-23.log matches
- Java进阶:SpringMVC文件上传
- paip.数组以及集合的操作uapi java php python总结..
- 蕊动矿机linux cpu超频,蚂蚁l3矿机超频方法!最佳超频参数! | 呆毛网
- VC6.0建立新工程的步骤---解决win11使用不了VC6的方法以及自用版本VC6下载
- keil、Proteus下载及安装教程
- 小程序之父子组件传值详解
- android集成建行龙支付,龙支付及建行信用卡分期支付SDK
- 开关电源初级和次级变压器之间的Y电容作用
- win10总显示打印机未连接服务器,win10系统打印机共享提示连接失败的解决方法...
- MOOC《Python语言程序设计》第6周练习题
- tlp导致linux运行缓慢,通过TLP改善Linux中的电源使用 | MOS86
- 华光昱能针对工程光纤布线的痛点?常见问题及解决方案
热门文章
- [C语言]求两个数的最小公倍数
- SQLSERVER一些公用DLL的作用解释
- kodi linux版本,如何在 Ubuntu 14.04 和 Linux Mint 17 中安装 Kodi14(XBMC)
- ESP8266和双向可控硅在调速调光中的应用
- 蓝牙5.2新特性及低功耗蓝牙音频(LE Audio)解读
- 超详细讲解ArcGIS中地形指标的提取(附练习数据下载)
- 单元测试与集成测试、系统测试、测试过程管理、软件测试自动化的综合练习
- java minor gc 停时,java Minor GC、 Full GC之间的区别
- 2013年北京市零分高考作文 爱迪生接见中国移动互联网大佬 探讨手机未来发展
- Gesture(手势)浅析