Why can't I connect to Git even though it worked before?
Asked Answered
F

1

1

This has been an issue for quite some time now and it really confuses me.

It all began with my university using a different vpn client. I need to be connected to vpn to access the git server of our lab and we need to use ssh (not sure why http won´t work but thats what I´ve been told when I started working on that project). Everything worked fine except for pushing. I could clone, pull, fetch but nor push. Back then I´ve been working with Ubuntu 16 so I blamed it on that.

Now I´m on Ubuntu 18 and I can only sporadically connect to Git. Just last week I was able to pull and push but now I get

fatal: Could not read from remote repository

or

Connection closed by 123.45.67.89 port xy

every time.

I´m using the same ssh-key as last week. I added the key with ssh-add and I tried restarting the ssh agent but nothing works. I reconnected to the vpn a few times but that won´t change a thing. I can access the git server with my browser though.

As far as I know I´m the only one facing such problems so it´s probably an issue on my side. I just don't get why the ssh key works every now and then even though I´m not doing anything different.

I´d be glad for every bit of advice as I´m not very versed with networks or git.

Ps: Another thing I´ve noticed: On Ubuntu 16 I´ve been able to add new ssh keys to my profile. Now I can see my ssh-keys and enter a new one but when I try to add it the website just loads and loads but nothing happens. This is very confusing for me because my account has the same permissions as it did before.

Forward answered 9/4, 2020 at 9:38 Comment(0)
M
5

At least the "just loads and loads" part of your PS sounds like a possible MTU problem. It isn't unusual for a VPN to reduce your MTU and depending on the product and configuration, the MTU may or may not be properly propagated to your system. Lowering the MTU of your VPN interface would then help.

To find the interface and its current MTU value use ip link (check the list with the VPN disconnected and connected to see what changes if it isn't obvious which interface is the VPN one). The MTU usually is somewhere around 1500 bytes.

Then lower the MTU using ip link set <vpnInterfaceName> mtu <newMTUValue>. Start out with a low value (1000 should work). If it is indeed an MTU problem, your connection should then start to work. You can then progressively increase the value until you see problems again (or keep it low, if you don't mind the increased overhead).

The MTU can also be set in the network configuration GUI, where it will also apply across reboots.

Matchbook answered 9/4, 2020 at 22:57 Comment(1)
You are a saint! Thanks a lot!Forward

© 2022 - 2024 — McMap. All rights reserved.