# /tmp/.ansible/tmp not write-able by all users

**URL:** <https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887>\
**Category:** Ansible Project\
**Created:** [March 2, 2018, 3:09pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887 "2018-03-02T15:09:49Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [March 2, 2018, 3:09pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887/1 "2018-03-02T15:09:49Z")

</div>

I changed remote\_tmp to /tmp/.ansible/tmp for performance reasons. The directory is created as follows:

[tmp]$ ls -ld .ansible  
drwx------ 3 ec2-user ec2-user 4096 Mar 2 09:47 .ansible

When a different user attempts to write to the directory it fails:

---

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [March 2, 2018, 3:16pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887/2 "2018-03-02T15:16:44Z")

</div>

Looks like /tmp/.ansible needs to be 777

---

<div class="post-metadata">

**Author:** ![tkuratom](https://avatars.discourse-cdn.com/v4/letter/t/b19c9b/32.png) [@tkuratom](https://forum.ansible.com/u/tkuratom)\
**Post date:** [March 2, 2018, 3:39pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887/3 "2018-03-02T15:39:17Z")

</div>

If you specify /tmp/.ansible/tmp as the remote\_tmp, then you become responsible for ensuring that the correct users have permission to read, write, and search that directory. Ansible deals with permissions below that directory only.

There was a bug in the 2.5 branch (I believe fixed in the latest rc) where ansible was supposed to revert to the system temp directory when remote\_user was unprivileged and become\_user was also unprivileged. What version of ansible are you using? (ansible --version output). That might tell us if this is related to that bug.

-Toshio

---

<div class="post-metadata">

**Author:** ![Mike\_Cavedon](https://avatars.discourse-cdn.com/v4/letter/m/e47774/32.png) [@Mike\_Cavedon](https://forum.ansible.com/u/Mike_Cavedon)\
**Post date:** [March 2, 2018, 3:49pm UTC](https://forum.ansible.com/t/tmp-ansible-tmp-not-write-able-by-all-users/26887/4 "2018-03-02T15:49:57Z")

</div>

I think the workaround/solution is to set remote\_tmp=/tmp. I prefer remote\_tmp to be a subdirectory under /tmp but it looks like that means I will have to deal with permissions which I prefer not to. I’m testing now. Thanks.
