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

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

问题描述

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

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

192.168.1.12 |无法访问!=> {改变":假,"msg": "ERROR!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天全站免登陆