# 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: mk

**URL:** <https://forum.ansible.com/t/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-mk/18032>\
**Category:** Ansible Project\
**Created:** [April 21, 2015, 9:10am UTC](https://forum.ansible.com/t/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-mk/18032 "2015-04-21T09:10:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![rrrkiran12](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@rrrkiran12](https://forum.ansible.com/u/rrrkiran12)\
**Post date:** [April 21, 2015, 9:10am UTC](https://forum.ansible.com/t/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-mk/18032/1 "2015-04-21T09:10:23Z")

</div>

I am getting this error when I ran the playbook for the remote node .

Could you please let me know how to resolve this error ?

---

<div class="post-metadata">

**Author:** ![Yassen\_Damyanov](https://avatars.discourse-cdn.com/v4/letter/y/9fc29f/32.png) [@Yassen\_Damyanov](https://forum.ansible.com/u/Yassen_Damyanov)\
**Post date:** [April 23, 2015, 7:15pm UTC](https://forum.ansible.com/t/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-mk/18032/2 "2015-04-23T19:15:04Z")

</div>

1. Quoting from openbsd netiquette: “No one other than you has the information needed to resolve your problem, it is better to provide more information than needed than one detail too little”.  
Ideas:  
– Provide your task or playbook code that spits out this error;  
– Run the command with -vvvv for maximum verbosity and check the output. If it does not speak much to you, provide it here to the list for help.

2. Please use short (but descriptive) subjects for your messages. By no means paste a long error message like that as a subject. (It seems truncated, btw.)

(And yes, your name as a signature will help people recognize you, which seems helpful.)

BR,  
Yassen

---

<div class="post-metadata">

**Author:** ![Laurent\_Hory](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Laurent\_Hory](https://forum.ansible.com/u/Laurent_Hory)\
**Post date:** [February 4, 2016, 3:22pm UTC](https://forum.ansible.com/t/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-mk/18032/3 "2016-02-04T15:22:42Z")

</div>

Hi,

I have a same issue.

Version:  
ansible --version 16:21:55  ✔ 0  
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz\_powm\_sec. You should rebuild using libgmp \>= 5 to avoid timing attack vulnerability.  
\_warn(“Not using mpz\_powm\_sec. You should rebuild using libgmp \>= 5 to avoid timing attack vulnerability.”, PowmInsecureWarning)  
ansible 2.0.0.2  
config file =  
configured module search path = Default w/o overrides

Command line  
$ ansible-playbook -i hosts playbook.yml -vvv  
/usr/lib64/python2.6/site-packages/Crypto/Util/number.py:57: PowmInsecureWarning: Not using mpz\_powm\_sec. You should rebuild using libgmp \>= 5 to avoid timing attack vulnerability.  
\_warn(“Not using mpz\_powm\_sec. You should rebuild using libgmp \>= 5 to avoid timing attack vulnerability.”, PowmInsecureWarning)  
Using /home\_raid1/laurent/dev/AIA/ansible.cfg as config file  
1 plays in playbook.yml

PLAY [create aia user] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

TASK [setup] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
\<3.249.12.53\> ESTABLISH SSH CONNECTION FOR USER: root  
\<3.249.12.53\> SSH: EXEC ssh -C -q -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=root -o ConnectTimeout=10 -o ControlPath=/home\_raid1/laurent/.ansible/cp/ansible-ssh-%h-%p-%r -tt 3.249.12.53 ‘mkdir -p “$( echo /tmp/ansible/$USER/ansible-tmp-1454599171.43-1430744300902 )” && echo “$( echo /tmp/ansible/$USER/ansible-tmp-1454599171.43-1430744300902 )”’  
fatal: [rubis]: UNREACHABLE! =\> {“changed”: false, “msg”: “ERROR! 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 "$( echo /tmp/ansible/$USER/ansible-tmp-1454599171.43-1430744300902 )" && echo "$( echo /tmp/ansible/$USER/ansible-tmp-1454599171.43-1430744300902 )", exited with result 1: Illegal variable name.\r\n”, “unreachable”: true}

PLAY RECAP \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*  
rubis : ok=0 changed=0 unreachable=1 failed=0

Playbook:

- name: “create aia user”  
hosts: “rubis”  
user: “root”  
roles:
- user

Role:

- name: create {{new\_user}} user  
user:  
name: “{{new\_user}}”  
password: “{{ password }}”  
comment: “specific aia user”  
group: “awuser”  
shell: “/bin/tcsh”  
groups: “awuser,iaa-v3d,sdc”  
append: “yes”  
state: “present”

- name: add cshrc files  
template: src=.AWArc  
dest=/home/{{new\_user}}/.AWArc  
template: src=.cshrc  
dest=/home/{{new\_user}}/.cshrc  
template: src=.cshrc.atria  
dest=/home/{{new\_user}}/.cshrc.atria

Thanks

---

<div class="post-metadata">

**Author:** ![Laurent\_Hory](https://avatars.discourse-cdn.com/v4/letter/l/4da419/32.png) [@Laurent\_Hory](https://forum.ansible.com/u/Laurent_Hory)\
**Post date:** [February 12, 2016, 10:02am UTC](https://forum.ansible.com/t/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-mk/18032/4 "2016-02-12T10:02:51Z")

</div>

On my workstation this issue is only with ansible 2.0.2.  
ansible 1.9.4 work

---

<div class="post-metadata">

**Author:** ![Timothy\_Vandenbrande](https://avatars.discourse-cdn.com/v4/letter/t/7ab992/32.png) [@Timothy\_Vandenbrande](https://forum.ansible.com/u/Timothy_Vandenbrande)\
**Post date:** [February 22, 2016, 1:57pm UTC](https://forum.ansible.com/t/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-mk/18032/5 "2016-02-22T13:57:25Z")

</div>

I can confirm this.  
I have this issue on ansible 2.0.0.2, but works on ansible 1.9.x  
I get this error whicle running a script on a windows host.

In playbook:

- name: set some default settings  
script: defaults.ps1

In output:

fatal: [acc-rt1903-sta]: UNREACHABLE! =\> {“changed”: false, “msg”: “ERROR! 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: PowerShell -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -EncodedCommand UwBlAHQALQBTAHQAcgBpAGMAdABNAG8AZABlACAALQBWAGUAcgBzAGkAbwBuACAATABhAHQAZQBzAHQACgAoAE4AZQB3AC0ASQB0AGUAbQAgAC0AVAB5AHAAZQAgAEQAaQByAGUAYwB0AG8AcgB5ACAALQBQAGEAdABoACAAJABlAG4AdgA6AHQAZQBtAHAAIAAtAE4AYQBtAGUAIAAiAGEAbgBzAGkAYgBsAGUALQB0AG0AcAAtADEANAA1ADYAMQA0ADgAOAA1ADAALgAyADMALQAxADQAMgA0ADcAOAA0ADQAOAA1ADMANwA4ADEANAAiACkALgBGAHUAbABsAE4AYQBtAGUAIAB8ACAAVwByAGkAdABlAC0ASABvAHMAdAAgAC0AUwBlAHAAYQByAGEAdABvAHIAIAAnACcAOwA=, exited with result 1”, “unreachable”: true}

---

<div class="post-metadata">

**Author:** ![j.r.hawkesworth](https://avatars.discourse-cdn.com/v4/letter/j/a3d4f5/32.png) [@j.r.hawkesworth](https://forum.ansible.com/u/j.r.hawkesworth)\
**Post date:** [February 22, 2016, 3:23pm UTC](https://forum.ansible.com/t/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-mk/18032/6 "2016-02-22T15:23:13Z")

</div>

Hi,

Can I check that you have replaced your ansible.cfg with a new version supplied with ansible 2.0.0.2?

Jon
