使用ansible远程服务器报错-用户密码问题

5 篇文章 0 订阅
2 篇文章 0 订阅
文章讲述了在使用Ansible执行mping任务时遇到的远程目录权限问题,提示可能因docker用户密码过期导致。作者提供了检查和解决方法,包括验证用户权限、调整docker密码有效期等。
摘要由CSDN通过智能技术生成
ansible -m ping -u docker dev
10.168.3.160 | UNREACHABLE! => {
    "changed": false,
    "msg": "Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp `\"&& mkdir \"` echo ~/.ansible/tmp/ansible-tmp-1687837948.0311582-49082-127934954449715 `\" && echo ansible-tmp-1687837948.0311582-49082-127934954449715=\"` echo ~/.ansible/tmp/ansible-tmp-1687837948.0311582-49082-127934954449715 `\" ), exited with result 1",
    "unreachable": true
}

报错信息:"msg": "Failed to create temporary directory. In some cases, you may have been able to authenticate and did not have permissions on the target directory. Consider changing the remote tmp path in ansible.cfg to a path rooted in \"/tmp\", for more error information use -vvv. Failed command was: ( umask 77 && mkdir -p \"` echo ~/.ansible/tmp `\"&& mkdir \"` echo ~/.ansible/tmp/ansible-tmp-1687837948.0311582-49082-127934954449715 `\" && echo ansible-tmp-1687837948.0311582-49082-127934954449715=\"` echo ~/.ansible/tmp/ansible-tmp-1687837948.0311582-49082-127934954449715 `\" ), exited with result 1",

排查思路:

1.使用docker用户查看远程目录是否有操作权限是否能登录

2.使用-vvv查看详细信息

发现是docker用户密码过期导致的,更新一下密码就好了

chage -l docker   查看信息
sudo chage -I -1 -m 0 -M 99999 -E -1 docker

这里的参数含义如下:

  • -I -1 密码立即过期
  • -m 0 密码修改后的等待时间为 0 天
  • -M 99999 密码有效期设置为 99999 天
  • -E -1 密码永不过期

  • 4
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值