# ssh connection closed waiting for password prompt

**URL:** <https://forum.ansible.com/t/ssh-connection-closed-waiting-for-password-prompt/13152>\
**Category:** Ansible Project\
**Tags:** windows, ubuntu\
**Created:** [July 18, 2013, 1:01pm UTC](https://forum.ansible.com/t/ssh-connection-closed-waiting-for-password-prompt/13152 "2013-07-18T13:01:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andy\_Wilde](https://avatars.discourse-cdn.com/v4/letter/a/cc9497/32.png) [@Andy\_Wilde](https://forum.ansible.com/u/Andy_Wilde)\
**Post date:** [July 18, 2013, 1:01pm UTC](https://forum.ansible.com/t/ssh-connection-closed-waiting-for-password-prompt/13152/1 "2013-07-18T13:01:31Z")

</div>

Hi

I’ve just started experimenting with Ansible to see if it’s possible to configure a number of Jenkins slaves. My first experiment to ping machineB from machineA was successful:

eanwwie@machineA:/home/eanwwie$ ansible -m ping machineB -k -vvv -k  
SSH password:  
 ESTABLISH CONNECTION FOR USER: eanwwie on PORT 22 TO machineB  
 EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692 && chmod a+rx $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692 && echo $HOME/.ansible/tmp/ansible-1374149419.03-33975991660692’  
 REMOTE\_MODULE ping  
 PUT /tmp/tmpnqCAAX TO /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ping  
 EXEC /bin/sh -c ‘/usr/bin/python /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ping; rm -rf /home/eanwwie/.ansible/tmp/ansible-1374149419.03-33975991660692/ \>/dev/null 2\>&1’  
machineB | success \>\> {  
“changed”: false,  
“ping”: “pong”  
}

But when I try to do this in sudo mode I get the error below:

eanwwie@machineA:/home/eanwwie$ ansible -m ping machineB -k -vvv -k --sudo -K  
SSH password:  
sudo password [defaults to SSH password]:  
 ESTABLISH CONNECTION FOR USER: eanwwie on PORT 22 TO machineB  
 EXEC /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036 && chmod a+rx $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036 && echo $HOME/.ansible/tmp/ansible-1374149543.45-250513362696036’  
 REMOTE\_MODULE ping  
 PUT /tmp/tmpWP3ATz TO /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ping  
 EXEC /bin/sh -c “sudo -k && sudo -H -S -p "[sudo via ansible, key=efqghgpcbafoylkvjmxtjaeicklbdlgd] password: " -u root /bin/sh -c ‘/usr/bin/python /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ping; rm -rf /home/eanwwie/.ansible/tmp/ansible-1374149543.45-250513362696036/ \>/dev/null 2\>&1’”  
machineB | FAILED =\> ssh connection closed waiting for password prompt

I suspect this is because the password prompt is the non-standard “Enter Windows password:”. Can anyone confirm this is true? If so, what can I do about it?

ansible version 1.2.2  
machineA: Ubuntu 10.04 LTS

machineB: Ubuntu 12.04 LTS

Thanks,

Andy

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [July 18, 2013, 9:08pm UTC](https://forum.ansible.com/t/ssh-connection-closed-waiting-for-password-prompt/13152/2 "2013-07-18T21:08:27Z")

</div>

We’re invoking sudo with the specified prompt so I’m inferring you changed the SSH login prompt?
