当前位置:网站首页>Ansible报错:“msg“: “Invalid/incorrect password: Permission denied, please try again.“
Ansible报错:“msg“: “Invalid/incorrect password: Permission denied, please try again.“
2022-07-06 22:36:00 【Steve lu】
这几天做Ansible的实验,做主机变量,连接时配置的用户的用户名和ssh密码,仅在未使用密钥对验证的情况下有效
错误
#Ansible管理端
[[email protected] ansible]# vim hosts
[dbservers]
192.168.109.134 ansible_port=2222 ansible_user=root ansible_password=000000
#被控制端
[[email protected] ~]# cat /etc/ssh/sshd_config |grep Port
Port 2222
[[email protected] ansible]# ansible 192.168.109.134 -a 'date'
192.168.109.134 | UNREACHABLE! => {
"changed": false,
"msg": "Invalid/incorrect password: Permission denied, please try again.",
"unreachable": true
}
提示报错,我很奇怪,以为是端口的问题,我又改成默认的22端口,还是一样的报错,报错信息说是密码问题,我仔细检查,密码就是000000没有问题,于是我去网上查了一下问题,得到了一个很令人匪夷所思的回答,说是密码的开头是0就会报错,于是我就去试验一下,改成123456后果然成功了。
成功
#Ansible端
[[email protected] ansible]# vim hosts
[lhq]
192.168.109.134 ansible_port=2222 ansible_user=root ansible_password=123123
#被管理端
[[email protected] ~]# passwd
更改用户 root 的密码 。
新的 密码:
无效的密码: 密码少于 8 个字符
重新输入新的 密码:
passwd:所有的身份验证令牌已经成功更新。
修改成123123
[[email protected] ansible]# ansible lhq -a 'date'
192.168.109.134 | CHANGED | rc=0 >>
2022年 07月 06日 星期三 16:16:13 CST
改完密码后果然成功了,难道真的是密码开头是0的原因么,我要再试验一下其他密码。
试验其他情况
因为131-133我之前做过密钥对验证,所以我先还原一下快照
#Ansible管理端
[[email protected] ansible]# vim hosts
[webservers]
192.168.109.131 ansible_user=root ansible_password=000000
192.168.109.132 ansible_user=root ansible_password=012345
192.168.109.133 ansible_user=root ansible_password=123123
192.168.109.134 ansible_user=root ansible_password=101111
#再分别去各个主机上改密码
[[email protected] ansible]# ansible webservers -a 'date'
192.168.109.134 | CHANGED | rc=0 >>
2022年 07月 06日 星期三 16:55:01 CST
192.168.109.133 | CHANGED | rc=0 >>
2022年 07月 06日 星期三 16:55:01 CST
192.168.109.131 | UNREACHABLE! => {
"changed": false,
"msg": "Invalid/incorrect password: Permission denied, please try again.",
"unreachable": true
}
192.168.109.132 | UNREACHABLE! => {
"changed": false,
"msg": "Invalid/incorrect password: Permission denied, please try again.",
"unreachable": true
}
[[email protected] ansible]# ansible webservers -m ping -o
192.168.109.134 | SUCCESS => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "ping": "pong"}
192.168.109.133 | SUCCESS => {"ansible_facts": {"discovered_interpreter_python": "/usr/bin/python"}, "changed": false, "ping": "pong"}
192.168.109.131 | UNREACHABLE!: Invalid/incorrect password: Permission denied, please try again.
192.168.109.132 | UNREACHABLE!: Invalid/incorrect password: Permission denied, please try again.
131和132机子出现问题,他们的密码是0开头
果然如网上那位兄弟所言,,0-9的数字里面只要开头取0的主机密码会产生本错误,其他数字都没问题。
边栏推荐
- Decorator basic learning 02
- Common methods of list and map
- What is JVM? What are the purposes of JVM tuning?
- acwing 843. n-皇后问题
- A line of R code draws the population pyramid
- 【數模】Matlab allcycles()函數的源代碼(2021a之前版本沒有)
- What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
- MySQL数据库(基础篇)
- B站大佬用我的世界搞出卷积神经网络,LeCun转发!爆肝6个月,播放破百万
- 【实践出真理】import和require的引入方式真的和网上说的一样吗
猜你喜欢
JS also exports Excel
A detailed explanation of head pose estimation [collect good articles]
装饰器基础学习02
Flask项目使用flask-socketio异常:TypeError: function() argument 1 must be code, not str
Win11 control panel shortcut key win11 multiple methods to open the control panel
计数排序基础思路
5G VoNR+之IMS Data Channel概念
MySQL forgot how to change the password
Lessons and thoughts of the first SQL injection
A row of code r shows the table of Cox regression model
随机推荐
AI表现越差,获得奖金越高?纽约大学博士拿出百万重金,悬赏让大模型表现差劲的任务
DFS and BFS concepts and practices +acwing 842 arranged numbers (DFS) +acwing 844 Maze walking (BFS)
九章云极DataCanvas公司摘获「第五届数字金融创新大赛」最高荣誉!
Zhou Yajin, a top safety scholar of Zhejiang University, is a curiosity driven activist
Lecture 3 of "prime mover x cloud native positive sounding, cost reduction and efficiency enhancement lecture" - kubernetes cluster utilization improvement practice
STM32F103ZE+SHT30检测环境温度与湿度(IIC模拟时序)
A picture to understand! Why did the school teach you coding but still not
Jetson nano configures pytorch deep learning environment / / to be improved
Canteen user dish relationship system (C language course design)
Intel David tuhy: the reason for the success of Intel aoten Technology
Thread和Runnable创建线程的方式对比
Meow, come, come: do you really know if, if else
【线段树实战】最近的请求次数 + 区域和检索 - 数组可修改+我的日程安排表Ⅰ/Ⅲ
架构实战训练营|课后作业|模块 6
mpf2_ Linear programming_ CAPM_ sharpe_ Arbitrage Pricin_ Inversion Gauss Jordan_ Statsmodel_ Pulp_ pLU_ Cholesky_ QR_ Jacobi
关于01背包个人的一些理解
ESG Global Leaders Summit | Intel Wang Rui: coping with global climate challenges with the power of science and technology
Markdown editor
《原动力 x 云原生正发声 降本增效大讲堂》第三讲——Kubernetes 集群利用率提升实践
JS variable plus