# SSH Connection does not complete.

**URL:** <https://forum.ansible.com/t/ssh-connection-does-not-complete/19658>\
**Category:** Ansible Project\
**Created:** [October 30, 2015, 4:55pm UTC](https://forum.ansible.com/t/ssh-connection-does-not-complete/19658 "2015-10-30T16:55:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jon\_Dison](https://avatars.discourse-cdn.com/v4/letter/j/eada6e/32.png) [@Jon\_Dison](https://forum.ansible.com/u/Jon_Dison)\
**Post date:** [October 30, 2015, 4:55pm UTC](https://forum.ansible.com/t/ssh-connection-does-not-complete/19658/1 "2015-10-30T16:55:50Z")

</div>

When attempting to run an ansible module on a remote host, the SSH connection never fully completes…

[myhost myusername 11:46:23]~ $ ansible -vvvvvvvvv -m setup -i ~/dave\_ansible/ansible/hosts.txt remotehost -u user -k -K --sudo  
SSH password:  
SUDO password[defaults to SSH password]:  
 ESTABLISH CONNECTION FOR USER: user  
 REMOTE\_MODULE setup  
 EXEC sshpass -d7 ssh -C -tt -vvv -o ControlMaster=auto -o ControlPersist=60s -o ForwardAgent=yes -o ControlPath=“/home/myusername/.ansible/cp/ansible-ssh-%h-%p-%r” -o GSSAPIAuthentication=no -o PubkeyAuthentication=no -o User=user -o ConnectTimeout=10 remotehost /bin/sh -c ‘mkdir -p $HOME/.ansible/tmp/ansible-tmp-1446223631.25-150226097303689 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1446223631.25-150226097303689 && echo $HOME/.ansible/tmp/ansible-tmp-1446223631.25-150226097303689’

Watching the connection on the far side, this is as far as it gets:

Oct 30 11:47:11 remotehost sshd[12366]: debug1: Forked child 12369.  
Oct 30 11:47:11 remotehost sshd[12369]: Set /proc/self/oom\_score\_adj to 0  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: rexec start in 5 out 5 newsock 5 pipe 7 sock 8  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: inetd sockets after dupping: 3, 3  
Oct 30 11:47:11 remotehost sshd[12369]: Connection from 1.2.3.4 port 48580  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: Client protocol version 2.0; client software version OpenSSH\_6.2  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: match: OpenSSH\_6.2 pat OpenSSH\*  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: Enabling compatibility mode for protocol 2.0  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: Local version string SSH-2.0-OpenSSH\_5.3  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: permanently\_set\_uid: 74/74  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: list\_hostkey\_types: ssh-rsa,ssh-dss  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_KEXINIT sent  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_KEXINIT received  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: kex: client-\>server aes128-ctr hmac-md5  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: kex: server-\>client aes128-ctr hmac-md5  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_KEX\_DH\_GEX\_REQUEST received  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_KEX\_DH\_GEX\_GROUP sent  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: expecting SSH2\_MSG\_KEX\_DH\_GEX\_INIT  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_KEX\_DH\_GEX\_REPLY sent  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_NEWKEYS sent  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: expecting SSH2\_MSG\_NEWKEYS  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: SSH2\_MSG\_NEWKEYS received  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: KEX done  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: userauth-request for user user service ssh-connection method none  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: attempt 0 failures 0  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: PAM: initializing for “user”  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: PAM: setting PAM\_RHOST to “1.2.3.4”  
Oct 30 11:47:11 remotehost sshd[12369]: debug1: PAM: setting PAM\_TTY to “ssh”  
Oct 30 11:47:11 remotehost sshd[12370]: debug1: userauth\_send\_banner: sent
