ansible 使用普通用户ssh免密登录提示无tmp权限
| 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 /tmp/.ansible1/tmp `\"&& mkdir \"` echo /tmp/.ansible1/tmp/ansible-tmp-1677205288.53-125475-28367539157477 `\" && echo ansible-tmp-1677205288.53-125475-28367539157477=\"` echo /tmp/.ansible1/tmp/ansible-tmp-1677205288.53-125475-28367539157477 `\" ), exited with result 1",
"unreachable": true
今天测试ansible的普通用户免密登录一直提示无tmp权限,一开始以为是免密问题,仔细看过-vvv的日志之后,是正常连接的,就是无法创建/tmp/.ansible1目录下临时文件,按道理不应该的,以为tmp目录是谁都可以使用的,去客户端机器上看,发现这个目录的属主是root,才想起来前期是通过root的远程管理的,应该是当时创建的root属主的临时文件。删除该目录重新远程执行命令成功!
有问题目录权限:
推荐本站淘宝优惠价购买喜欢的宝贝:
本文链接:https://hqyman.cn/post/4036.html 非本站原创文章欢迎转载,原创文章需保留本站地址!
打赏微信支付宝扫一扫,打赏作者吧~
休息一下~~
作者:hqy | 分类:技术文章 | 浏览:703 | 评论:0