# Can't ping remote server(s) from non-root user

**URL:** <https://forum.ansible.com/t/cant-ping-remote-server-s-from-non-root-user/19998>\
**Category:** Ansible Project\
**Created:** [December 13, 2015, 8:18pm UTC](https://forum.ansible.com/t/cant-ping-remote-server-s-from-non-root-user/19998 "2015-12-13T20:18:24Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Colin\_Byrne](https://avatars.discourse-cdn.com/v4/letter/c/ecd19e/32.png) [@Colin\_Byrne](https://forum.ansible.com/u/Colin_Byrne)\
**Post date:** [December 13, 2015, 8:18pm UTC](https://forum.ansible.com/t/cant-ping-remote-server-s-from-non-root-user/19998/1 "2015-12-13T20:18:24Z")

</div>

Hey,

So I am just getting started with Ansible, and have been able to ping a remote server with root access, but I am having trouble doing the same without root access. Running with verbose output I get:

ansible all --check -m ping -vvvv -i /usr/local/bin/ansible\_comp/hosts\_next\_version

ESTABLISH CONNECTION FOR USER: joe

REMOTE\_MODULE ping CHECKMODE=True

EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath=“/Users/joe/.ansible/cp/ansible-ssh-%h-%p-%r” -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 server-1 /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1450036007.2-120481441078037 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1450036007.2-120481441078037 && echo $HOME/.ansible/tmp/ansible-tmp-1450036007.2-120481441078037’

PUT /var/folders/pt/ld9k57zd2qz4yf6h\_7k3c24m0000gp/T/tmpSCboHh TO /home/deploy/.ansible/tmp/ansible-tmp-1450036006.88-248428083902840/ping

server-1 | FAILED =\> failed to transfer file to /home/deploy/.ansible/tmp/ansible-tmp-1450036006.88-227828078688673/ping:

Connection closed

If it was any command other than ping it seems obvious enough how to run as the sudo user, which I assume would fix the issue. With ping, I am not sure where to specify that i’d like to run as sudo. Or maybe the issue has nothing to do with sudo access?

Sincere thanks for any help!

---

<div class="post-metadata">

**Author:** ![sivel](https://sea1.discourse-cdn.com/ansible/user_avatar/forum.ansible.com/sivel/32/1198_2.png) [@sivel](https://forum.ansible.com/u/sivel)\
**Post date:** [December 14, 2015, 2:42pm UTC](https://forum.ansible.com/t/cant-ping-remote-server-s-from-non-root-user/19998/2 "2015-12-14T14:42:03Z")

</div>

It looks like the SFTP to put a file onto the remote server is failing.

Do you have anything in your profile on the remote side that may be echoing on login? I believe SFTP will have issues if that is the case.

Another option is to try setting `scp_if_ssh = True` in your ansible.cfg under the `[ssh_connection]` section.
