身份验证或权限失败,对远程目录没有权限 [英] Authentication or permission failure, did not have permissions on the remote directory

查看:604
本文介绍了身份验证或权限失败,对远程目录没有权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ansijet来自动化ansible剧本,只需单击一下按钮即可运行.该手册旨在停止AWS上正在运行的实例.如果从命令行手动运行,则剧本可以正常运行并完成任务.但是当通过ansijet的Web界面运行时,遇到以下错误

I am using ansijet to automate the ansible playbook to be run on a button click. The playbook is to stop the running instances on AWS. If run, manually from command-line, the playbook runs well and do the tasks. But when run through the web interface of ansijet, following error is encountered

Authentication or permission failure.  In some cases, you may have been able to authenticate and did not have permissions on the remote directory. Consider changing the remote temp path in ansible.cfg to a path rooted in "/tmp". Failed command was: mkdir -p $HOME/.ansible/tmp/ansible-tmp-1390414200.76-192986604554742 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1390414200.76-192986604554742 && echo $HOME/.ansible/tmp/ansible-tmp-1390414200.76-192986604554742, exited with result 1:

以下是ansible.cfg配置.

# some basic default values...

inventory      = /etc/ansible/hosts
#library        = /usr/share/my_modules/
remote_tmp     = $HOME/.ansible/tmp/
pattern        = *
forks          = 5
poll_interval  = 15
sudo_user      = root
#ask_sudo_pass = True
#ask_pass      = True
transport      = smart
#remote_port    = 22
module_lang    = C

我尝试将remote_tmp路径更改为/home/ubuntu/.ansible/tmp 但是仍然出现相同的错误.

I try to change the remote_tmp path to /home/ubuntu/.ansible/tmp But still getting the same error.

推荐答案

默认情况下,用户Ansible连接到远程服务器,其名称与用户ansible运行时的名称相同.对于Ansijet,它将以任何用户启动Ansijet的node.js进程的方式尝试连接到远程服务器.您可以在剧本中指定remote_user或在ansible.cfg文件中全局指定它.

By default, the user Ansible connects to remote servers as will be the same name as the user ansible runs as. In the case of Ansijet, it will try to connect to remote servers with whatever user started Ansijet's node.js process. You can override this by specifying the remote_user in a playbook or globally in the ansible.cfg file.

Ansible将尝试创建临时目录(如果尚不存在),但是如果该用户没有主目录或者其主目录权限不允许他们进行写访问,则将无法创建.

Ansible will try to create the temp directory if it doesn't already exist, but will be unable to if that user does not have a home directory or if their home directory permissions do not allow them write access.

我实际上将ansible.cfg文件中的temp目录更改为指向/tmp中的某个位置,该位置可解决这些问题.

I actually changed the temp directory in my ansible.cfg file to point to a location in /tmp which works around these sorts of issues.

remote_tmp = /tmp/.ansible-${USER}/tmp

这篇关于身份验证或权限失败,对远程目录没有权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆