ansible Failed to connect to the host via ssh: no such identity: /root/.ssh/id_rsa.bak

中控机和远端主机配置完密钥后,在中控台上通过ansible检测联通性

ansible -i inventory.cfg all -m ping
10.1.1.1 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to connect to the host via ssh: no such identity: /root/.ssh/id_rsa.bak: No such file or directory\r\nPermission denied (publickey,gssapi-keyex,gssapi-with-mic,password).\r\n",
    "unreachable": true
}

通过调试选项查看

ansible -vvv -i inventory.cfg all -m ping
ansible 2.6.2
  config file = /home/bichenchen001/mongodb_auto_deploy/ansible.cfg
  configured module search path = [u‘/root/.ansible/plugins/modules‘, u‘/usr/share/ansible/plugins/modules‘]
  ansible python module location = /usr/lib/python2.7/site-packages/ansible
  executable location = /bin/ansible
  python version = 2.7.5 (default, Apr 11 2018, 07:36:10) [GCC 4.8.5 20150623 (Red Hat 4.8.5-28)]
Using /home/bichenchen001/mongodb_auto_deploy/ansible.cfg as config file
Parsed /home/bichenchen001/mongodb_auto_deploy/inventory.cfg inventory source with ini plugin
META: ran handlers
<10.1.1.1> ESTABLISH SSH CONNECTION FOR USER: None
<10.1.1.1> SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o ‘IdentityFile="/root/.ssh/id_rsa.bak"‘ -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 -o 

发现会指定 /root/.ssh/id_rsa.bak  手动创建文件解决问题

cp /root/.ssh/id_rsa /root/.ssh/id_rsa.bak
 

原文地址:https://www.cnblogs.com/Bccd/p/9454301.html

时间: 2024-10-15 16:03:18

ansible Failed to connect to the host via ssh: no such identity: /root/.ssh/id_rsa.bak的相关文章

jenkins集成ansible注意事项Failed to connect to the host via ssh.

在集成jenkins和ansible实现自动化部署时,root用户下执行ansible命令时可以正常运行.由于是通过jenkins用户去执行ansible命令,而jenkins用户却报如下异常: XXXXXXX | UNREACHABLE! => { "changed": false, "msg": "Failed to connect to the host via ssh.", "unreachable": true

解决Failed to connect session for conifg 故障

服务器升级openssh之后jenkins构建报错了,报错信息如下: Failed to connet or change directory jenkins.plugins.publish_over.BapPublisherException:Failed to connect session for config.....Message [Algorithm negotiation fail] 升级前ssh版本:OpenSSH_5.3p1 升级后sshl版本:OpenSSH_6.8pl 解决

Selenium2学习-007-WebUI自动化实战实例-005-解决 Firefox 版本不兼容:org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary

此文主要讲述 Java 运行 Selenium 脚本时,因 Friefox 浏览器版本与 selenium-server-standalone-x.xx.x.jar 不兼容引起的 org.openqa.selenium.WebDriverException: Failed to connect to binary FirefoxBinary 报错解决方法. 希望能对初学 Selenium2 WebUI 自动化测试编程的亲们有所帮助.若有不足之处,敬请大神指正,不胜感激! 之前给朋友初步介绍了 S

start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart:

用Ubuntu远程登录虚拟host时出现:    start: Unable to connect to Upstart: Failed to connect to socket /com/ubuntu/upstart: Connection refused 解决: sudo dpkg-divert --local --rename --add /sbin/initctl ln -s /bin/true /sbin/initctl        PS:输入命令就好,至于出现什么不用管.然后,再执

【LR11】Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误解决办法

  场景描述:被测系统是发布在远程服务器上的,假设IP是10.10.10.10,端口是8066,那么访问地址是http://10.10.10.10:8066/,在control机器上我设置了IP欺骗. 错误现象:在场景运行时出现大量Action.c(8): Error -27796: Failed to connect to server"server:port": [10060] Connection timed out错误. 官方的troubleshooting: 查看工具的tro

spark-client 一直 accepted,无法提交任务,报错Failed to connect to driver at

这个问题的原因有几个: 1.客户端安装的机器一般是虚拟机,虚拟机的名称可能是随便搞的,然而,yarn-client模式提交任务,是默认把本机当成driver的.所以导致其他的机器无法通过host的name直接访问这台机器.报错就是Failed to connect to driver at x.x.x.x,retrying..... 解决办法:在命令后面加上一个--conf spark.driver.host=$your_ip_address,后面直接填客户端机器的IP地址就行.还有一个办法:e

Action.c(28): Error -27796: Failed to connect to server &quot;xxxx&quot;: [10060] Connection timed out

Error -27796: Failed to connect to server "125.93.51.230:8080": [10061] Connection refused.. 2013.05.31,这个27796一直是我心中的痛,试过网上所有的方法了,还是不行,我只能怀疑是不是我的客户端OS是win7的,所以才造成这种情况.....哎~! 认真分析这个错误,其实比较容易理解,就是连接不上服务,由于端口已经满了,那么自己的本机已经修改成65534,服务器已经修成成65534,那

Unable to connect to the MKS: Failed to connect to &lt;server IP&gt;:902.控制台黑屏

本人此次遇到此问题的是VSphere 5.1. 在此问题出现之前都正常,没出过任何问题,问之做过什么动作,是客户重配了网络,这其实是我要求改的,但是客户改的和我要求的不一样. 我计划是vswitch0做管理,vswitch1做vmotion,vswitch2做vm network:由于安装ESXI 5.1时自动生成vswitch0:10.23.70.60,客户误搭建了vswitch1:10.23.70.54做管理,vswitch2做vmotion,vswitch3做vm network,且vsw

解决openstack “failed to connect to server (code: 1006)”故障一例

openstack版本环境:ocata 安装完成ocata版本后,新建主机实例后,通过管理端进入主机实例的控制台时,报错:"failed to connect to server (code: 1006)" 解决思路: 1.检查日志文件,通过日志寻找原因. tail -f /var/log/nova/nova-novncproxy.log 发现连接5900时出现"Name or service not known" 2017-05-17 17:01:43.994 7