# What to do when sudo password prompt is hidden

**URL:** <https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646>\
**Category:** Ansible Project\
**Created:** [October 30, 2014, 4:44pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646 "2014-10-30T16:44:45Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alex\_Scoble](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Alex\_Scoble](https://forum.ansible.com/u/Alex_Scoble)\
**Post date:** [October 30, 2014, 4:44pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/1 "2014-10-30T16:44:45Z")

</div>

I’m using Ansible to do an ad-hoc command against multiple systems. The command does a wget and then pipes to sudo sh. Obviously, I’m using the shell module to do this.

Psuedo command: ansible group -B 1800 -P 30 -m shell -a ‘wget -O - [http://some.url.com](http://some.url.com) | sudo sh’ --ask-pass --sudo --ask-sudo-pass

Problem is that sometimes, when this is done, sudo password prompt is hidden until user hits enter on keyboard.

How can I get Ansible beyond this issue?

Thanks,

Alex

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 30, 2014, 5:12pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/2 "2014-10-30T17:12:18Z")

</div>

you don’t need the sudo in the command line, which is probably causing the issue.

_cringe_ at running script from the web as root _cringe_

---

<div class="post-metadata">

**Author:** ![Alex\_Scoble](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Alex\_Scoble](https://forum.ansible.com/u/Alex_Scoble)\
**Post date:** [October 30, 2014, 5:26pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/3 "2014-10-30T17:26:11Z")

</div>

One solution is to do this instead:

ansible group -B 1800 -P 30 -m shell -a ‘wget -O /tmp/dosomething [http://some.ur.com/somefile](http://some.ur.com/somefile) && ls -l /tmp/dosomething && sudo /bin/bash /tmp/dosomething’ --ask-pass --sudo --ask-sudo-pass

Not sure why doing it the other way sometimes has the prompt issue.

Alex

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 30, 2014, 5:28pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/4 "2014-10-30T17:28:54Z")

</div>

With && the things get executed sequentially, with | they get executed almost synchronously, so it has a race condition between your explicit sudo and the sudo ansible runs being fed the password before your’s prompts for it.

---

<div class="post-metadata">

**Author:** ![Alex\_Scoble](https://avatars.discourse-cdn.com/v4/letter/a/3e96dc/32.png) [@Alex\_Scoble](https://forum.ansible.com/u/Alex_Scoble)\
**Post date:** [October 30, 2014, 5:29pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/5 "2014-10-30T17:29:07Z")

</div>

Oh, yeah, dumb mistake.

And it’s not from the “web”, it’s from an internal package source that just happens to be a web site.

Thanks,

Alex

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [October 30, 2014, 5:34pm UTC](https://forum.ansible.com/t/what-to-do-when-sudo-password-prompt-is-hidden/16646/6 "2014-10-30T17:34:30Z")

</div>

Now I'll sleep a bit better.
