git pull does nothing / git push just hangs / debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

14

5

I had an issue in ubuntu 13.10 and 12.10 where attempting to connect to github (git clone / pull / push or anything) would fail with no output.

I checked my /.ssh directory for config and any ssh keys. Had no config file and the ssh key for id_rsa was the same one that was live on my github.com account.

I attempted to ping the github servers and was able too.

I followed the github guide to debug the situation - it suggests

ssh -T -v git@github.com

The output stops at:

debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY

Anyone have a solution to allow my git pull / push etc to work.

Jason

Posted 2014-01-09T23:31:15.567

Reputation: 1 619

Answers

16

The solution was found here: SSH works in putty but not terminal

in Ubuntu 13.10/12.10, login and gain sudo access.

Edit /etc/ssh/ssh_config, uncomment the following lines

Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160

Add the following line

HostKeyAlgorithms ssh-rsa,ssh-dss

You should end up with your /etc/ssh/ssh_config file looking like this

Host *
Ciphers aes128-ctr,aes192-ctr,aes256-ctr,arcfour256,arcfour128,aes128-cbc,3des-cbc
MACs hmac-md5,hmac-sha1,umac-64@openssh.com,hmac-ripemd160
SendEnv LANG LC_*
HashKnownHosts yes
GSSAPIAuthentication yes
GSSAPIDelegateCredentials no
HostKeyAlgorithms ssh-rsa,ssh-dss

Now run ssh -T -v git@github.com and it will ask you to add the server to your known hosts file. Hit yes, and then it should welcome you to the server.

Hi ****! You've successfully authenticated, but GitHub does not provide shell access.

Jason

Posted 2014-01-09T23:31:15.567

Reputation: 1 619

1Old question but: can you tell me why the problem emerges and how the addition of these lines resolves it? – paljenczy – 2016-05-12T15:29:36.620

Linked answer explains it – musicin3d – 2019-09-16T16:07:57.190

4

Change the network interface MTU to solve it. This is a bug for ubuntu 14.04.

This worked for me:

sudo ip li set mtu 1200 dev wlan0

ssh fails to connect to VPN host - hangs at 'expecting SSH2_MSG_KEX_ECDH_REPLY'

shgnInc

Posted 2014-01-09T23:31:15.567

Reputation: 375

for arch that’s sudo ip li set mtu 1200 dev vpn0 – flying sheep – 2015-08-06T21:41:22.470