当前位置:网站首页>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的主机密码会产生本错误,其他数字都没问题。
边栏推荐
- 一度辍学的数学差生,获得今年菲尔兹奖
- 一图看懂!为什么学校教了你Coding但还是不会的原因...
- Terms used in the Web3 community
- Tree map: tree view - draw covid-19 array diagram
- What if win11 pictures cannot be opened? Repair method of win11 unable to open pictures
- JS variable
- Oracle -- 视图与序列
- STM32封装ESP8266一键配置函数:实现实现AP模式和STA模式切换、服务器与客户端创建
- Programmers go to work fishing, so play high-end!
- Case reward: Intel brings many partners to promote the innovation and development of multi domain AI industry
猜你喜欢
Depth first traversal template principle of tree and graph
A line of R code draws the population pyramid
Kivy tutorial of setting the size and background of the form (tutorial includes source code)
AttributeError: module ‘torch._C‘ has no attribute ‘_cuda_setDevice‘
acwing 843. n-皇后问题
What about the collapse of win11 playing pubg? Solution to win11 Jedi survival crash
What if the win11 screenshot key cannot be used? Solution to the failure of win11 screenshot key
Local tool [Navicat] connects to remote [MySQL] operation
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
01 machine learning related regulations
随机推荐
In depth analysis of kubebuilder
Two divs are on the same line, and the two divs do not wrap "recommended collection"
食堂用户菜品关系系统(C语言课设)
01机器学习相关规定
This "advanced" technology design 15 years ago makes CPU shine in AI reasoning
MySQL forgot how to change the password
Markdown编辑器
Structure actual training camp | after class homework | module 6
PLC Analog output analog output FB analog2nda (Mitsubishi FX3U)
Chapter 9 Yunji datacanvas was rated as 36 krypton "the hard core technology enterprise most concerned by investors"
System framework of PureMVC
日常工作中程序员最讨厌哪些工作事项?
leetcode 53. Maximum subarray maximum subarray sum (medium)
使用Thread类和Runnable接口实现多线程的区别
九章云极DataCanvas公司获评36氪「最受投资人关注的硬核科技企业」
深入解析Kubebuilder
Jetson nano配置pytorch深度学习环境//待完善
赠票速抢|行业大咖纵论软件的质量与效能 QECon大会来啦
PLC模拟量输出 模拟量输出FB analog2NDA(三菱FX3U)
Deeply cultivate the developer ecosystem, accelerate the innovation and development of AI industry, and Intel brings many partners together