Ansible:权限被拒绝(公钥,密码) [英] Ansible: Permission denied (publickey, password)

查看:761
本文介绍了Ansible:权限被拒绝(公钥,密码)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法连接到Ansible中的主机.这是错误:

I'm not able to connect to a host in Ansible. This is the error:

192.168.1.12 |难以置信! => { 已更改":错误, "msg":错误!SSH在连接期间遇到未知错误.我们建议您使用-vvvv重新运行该命令, 将启用SSH调试输出以帮助诊断问题", "unreachable":true}

192.168.1.12 | UNREACHABLE! => { "changed": false, "msg": "ERROR! SSH encountered an unknown error during the connection. We recommend you re-run the command using -vvvv, which will enable SSH debugging output to help diagnose the issue", "unreachable": true }

这是我的hosts文件:

[test]
192.168.1.12

这是临时说明:

ansible all -m ping

我可以通过原始的ssh连接.

I'm able to connect via raw ssh.

推荐答案

默认情况下,Ansible尝试使用SSH密钥.看来您输入的密码错误.尝试使用密码身份验证.

By default Ansible try to use SSH keys. It seems that you have wrong keys. Try to use Password authentication.

ansible all -m ping --ask-pass --ask-sudo-pass

我希望能帮上忙.

这篇关于Ansible:权限被拒绝(公钥,密码)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆