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

42 views
Skip to first unread message

Colin Byrne

unread,
Dec 14, 2015, 9:18:21 AM12/14/15
to Ansible Project
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 


<server-1> ESTABLISH CONNECTION FOR USER: joe

<server-1> REMOTE_MODULE ping CHECKMODE=True

<server-1> 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'

<server-1> 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!

Matt Martz

unread,
Dec 14, 2015, 9:42:49 AM12/14/15
to ansible...@googlegroups.com
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.

--
You received this message because you are subscribed to the Google Groups "Ansible Project" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ansible-proje...@googlegroups.com.
To post to this group, send email to ansible...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/17d24715-43e4-4408-8033-eeb41d91ec46%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Matt Martz
@sivel
sivel.net
Reply all
Reply to author
Forward
0 new messages