SSH connection to host failed..

872 views
Skip to first unread message

Andrzej K

unread,
Mar 18, 2016, 4:00:14 PM3/18/16
to Ansible Project
Hello Guys,

Can someone of you help me with this strange case? I have host running CentOS 6.7 x86_64. My ansible management host is CentOS 7.2 x86_64, ansible version 1.9.4. When I try to run playbook against my host I'm getting this message:

GATHERING FACTS ***************************************************************
failed: [vzylvrnddev3] => {"failed": true, "parsed": false}
/var/tmp/sclAxMdst: line 8: -k: command not found
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: auto-mux: Trying existing master
debug1: mux_client_request_session: master session id: 2
Shared connection to vzylvrnddev3 closed.


for more info:

GATHERING FACTS ***************************************************************
<vzylvrnddev3> ESTABLISH CONNECTION FOR USER: ansible
<vzylvrnddev3> REMOTE_MODULE setup
<vzylvrnddev3> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/ansible-admin/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 vzylvrnddev3 /bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679 && echo $HOME/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679'
<vzylvrnddev3> PUT /tmp/tmpCkdV99 TO /home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/setup
<vzylvrnddev3> EXEC ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/home/ansible-admin/.ansible/cp/ansible-ssh-%h-%p-%r" -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=ansible -o ConnectTimeout=10 vzylvrnddev3 /bin/sh -c 'sudo -k && sudo -H -S -p "[sudo via ansible, key=] password: " -u root /bin/sh -c '"'"'echo BECOME-SUCCESS-; LANG=C LC_CTYPE=C /usr/bin/python /home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/setup; rm -rf /home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/ >/dev/null 2>&1'"'"''
failed: [vzylvrnddev3] => {"failed": true, "parsed": false}
/var/tmp/sclRLbVXV: line 8: -k: command not found
OpenSSH_6.6.1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 56: Applying options for *
debug1: auto-mux: Trying existing master
debug2: fd 3 setting O_NONBLOCK
debug2: mux_client_hello_exchange: master version 4
debug3: mux_client_forwards: request forwardings: 0 local, 0 remote
debug3: mux_client_request_session: entering
debug3: mux_client_request_alive: entering
debug3: mux_client_request_alive: done pid = 5502
debug3: mux_client_request_session: session request sent
debug1: mux_client_request_session: master session id: 2
debug3: mux_client_read_packet: read header failed: Broken pipe
debug2: Received exit status from master 127
Shared connection to vzylvrnddev3 closed.


Any idea why I'm getting this message? I restored /etc/ssh/sshd_config and ssh_config to default - it's still the same. What is the reason?

thanks in advance!

alfred....@gmail.com

unread,
May 13, 2017, 9:09:30 AM5/13/17
to Ansible Project
I have nearly the exact same issue. Have you managed to find a solution?

Dick Davies

unread,
May 13, 2017, 10:51:15 AM5/13/17
to ansible list
ConnectTimeout=10 vzylvrnddev3 /bin/sh -c 'sudo -k && sudo -H -S -p
"[sudo via ansible, key=] password: " -u root /bin/sh -c '"'"'echo
BECOME-SUCCESS-; LANG=C LC_CTYPE=C /usr/bin/python
/home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/setup;
rm -rf /home/ansible/.ansible/tmp/ansible-tmp-1458307518.98-232218326920679/
>/dev/null 2>&1'"'"''
failed: [vzylvrnddev3] => {"failed": true, "parsed": false}
/var/tmp/sclRLbVXV: line 8: -k: command not found


Does the sudo on the host not understand the '-k' flag?
> --
> 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/6633775f-42e0-4139-89e0-14fcefe44a59%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

alfred....@gmail.com

unread,
May 14, 2017, 11:21:43 AM5/14/17
to Ansible Project
As it turns out, in my case the issue was that sftp was purposefully unsupported on the remote machine. Switching to scp solved this problem.
Reply all
Reply to author
Forward
0 new messages