# failed connecting to remote host

**URL:** <https://forum.ansible.com/t/failed-connecting-to-remote-host/20588>\
**Category:** Ansible Project\
**Created:** [February 16, 2016, 4:59am UTC](https://forum.ansible.com/t/failed-connecting-to-remote-host/20588 "2016-02-16T04:59:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mahendra](https://avatars.discourse-cdn.com/v4/letter/m/779978/32.png) [@Mahendra](https://forum.ansible.com/u/Mahendra)\
**Post date:** [February 16, 2016, 4:59am UTC](https://forum.ansible.com/t/failed-connecting-to-remote-host/20588/1 "2016-02-16T04:59:36Z")

</div>

Greetings,

I am to connect few hosts but on few hosts i am get the following error

bash-3.2# ansible app\_servers -m shell -a “sudo uptime” -u user2 --ask-pass -k -K --sudo  
SSH password:  
SUDO password[defaults to SSH password]:  
[host1.example.com](http://host1.example.com) | FAILED \>\> {  
“failed”: true,  
“msg”: “\r\nSorry, user user2 is not allowed to execute ‘/bin/sh -c echo BECOME-SUCCESS-drfmorbvjwjghwkuetggsuofxdhdgcjo; LANG=C LC\_CTYPE=C /usr/bin/python /tmp/.ansible-user2/tmp/ansible-tmp-1455598070.31-118593960300261/command; rm -rf /tmp/.ansible-user2/tmp/ansible-tmp-1455598070.31-118593960300261/ \>/dev/null 2\>&1’ as root on host1.\r\n”,  
“parsed”: false  
}

I can able to ssh the servers with no issues .
