Ssh connection to gitlab.com fails behind home router, but is fine when at workplace. However, Github and Bitbucket over ssh are fine at home

githttpsssh

I am trying to connect to my repository on gitlab.com.

It used to work on my laptop both when I was at home and when I was at work. I was using ssh and had added the ssh keys to gitlab.

Suddenly some days ago it stopped working from home:
I get:

$ git pull
Connection closed by 54.93.71.23
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

From within my work network, on the same laptop it works fine using ssh.

So now I switched to https and it works most of the time, but ocassionally it hangs and I get:

fatal: The remote end hung up unexpectedly
error: RPC failed; result=56, HTTP code = 0

From my work, this never happens, even if I try to commit the same changes just half an hour later.

What could be the problem with ssh? Am I behind a router firewall or did my provider change something?

EDIT 1: Output of git pull, adding LogLevel DEBUG3 to my .ssh/config:

debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: none,zlib@openssh.com
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: 
debug2: kex_parse_kexinit: first_kex_follows 0 
debug2: kex_parse_kexinit: reserved 0 
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: server->client aes128-ctr umac-64-etm@openssh.com none
debug2: mac_setup: setup umac-64-etm@openssh.com
debug1: kex: client->server aes128-ctr umac-64-etm@openssh.com none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
Connection closed by 54.93.71.23
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

EDIT 2: The connection over https hangs ocassionally, but after many tests there were no MTU problems on my side. Probably the provider had some failures.
Github and Bitbucket work perfectly fine over ssh.

Thanks!

Best Answer

Edit your /etc/ssh/ssh_config to:

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