# Sudo nuances

**URL:** <https://forum.ansible.com/t/sudo-nuances/16421>\
**Category:** Ansible Project\
**Created:** [October 3, 2014, 5:30pm UTC](https://forum.ansible.com/t/sudo-nuances/16421 "2014-10-03T17:30:06Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tiglath](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@Tiglath](https://forum.ansible.com/u/Tiglath)\
**Post date:** [October 3, 2014, 5:30pm UTC](https://forum.ansible.com/t/sudo-nuances/16421/1 "2014-10-03T17:30:06Z")

</div>

When trying this on Solaris 11 server.

ansible --sudo -i hosts -m file -a “state=directory dest=/export/home/foo”

sudo password:

I kept getting this error:

| FAILED =\> ssh connection closed waiting for sudo or su password prompt

I tried putting this on /etc/sudoers:

Default;: !requiretty

Same error. But it disappear when I changed pipelinining to false in the ansible config file.

However, the sudo permissions needed are to execute bash, not mkdir.

"Sorry, user is not allowed to execute ‘/bin/bash -c echo SUDO-SUCCESS-xmmcizgbypydurtfuarqtsrufpgbwgoe; LC\_CTYPE=C LANG=C…’

which is to ask a lot in my environment – banking – so it looks like for sudo operations I won’t be able to use Ansible sudo, but I will have to do it inside scripts and use the script module.

I suspect there is no way around this. Right?

---

<div class="post-metadata">

**Author:** ![Strahinja\_Kustudic2](https://avatars.discourse-cdn.com/v4/letter/s/b4bc9f/32.png) [@Strahinja\_Kustudic2](https://forum.ansible.com/u/Strahinja_Kustudic2)\
**Post date:** [October 5, 2014, 7:29pm UTC](https://forum.ansible.com/t/sudo-nuances/16421/2 "2014-10-05T19:29:25Z")

</div>

To be able to use sudo with Ansible, you will need to allow the user Ansible is login as full rights to execute all commands.

I’m curious, how did you configure your sudoers files, since I don’t see you executing any commands, but using the file module.

---

<div class="post-metadata">

**Author:** ![Tiglath](https://avatars.discourse-cdn.com/v4/letter/t/df705f/32.png) [@Tiglath](https://forum.ansible.com/u/Tiglath)\
**Post date:** [October 8, 2014, 4:57pm UTC](https://forum.ansible.com/t/sudo-nuances/16421/3 "2014-10-08T16:57:56Z")

</div>

My sudoers file specifies the paths of commands I may use, bash in not one of them.

Thank you for your reply.
