2

few days ago everything working fine. now ssh -T git@gitlab.com and ssh -T git@github.com give me the same output kex_exchange_identification: read: Connection reset by peer.

I've tried some suggestions on the internet with no luck. I'm using Ubuntu 20.04 and git version 2.25.1

ssh -Tv git@gitlab.com give this output

OpenSSH_8.2p1 Ubuntu-4ubuntu0.3, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.
debug1: identity file /home/fazar/.ssh/id_rsa type 0
debug1: identity file /home/fazar/.ssh/id_rsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_dsa type -1
debug1: identity file /home/fazar/.ssh/id_dsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa_sk type -1
debug1: identity file /home/fazar/.ssh/id_ecdsa_sk-cert type -1
debug1: identity file /home/fazar/.ssh/id_ed25519 type -1
debug1: identity file /home/fazar/.ssh/id_ed25519-cert type -1
debug1: identity file /home/fazar/.ssh/id_ed25519_sk type -1
debug1: identity file /home/fazar/.ssh/id_ed25519_sk-cert type -1
debug1: identity file /home/fazar/.ssh/id_xmss type -1
debug1: identity file /home/fazar/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_8.2p1 Ubuntu-4ubuntu0.3
kex_exchange_identification: read: Connection reset by peer
Fazar
  • 23
  • 1
  • 1
  • 5

1 Answers1

2

Check your ssh config, as in gitlab-org/gitlab issue 121570

I found out that the port in my /etc/ssh/ssh_config file was accidentally changed.
Once I changed the port in /etc/ssh/ssh_config back to 22, I was able to connect to Gitlab.

Try ssh -Tv git@gitlab.com to see more.

The OP Fazar confirms in the comments that upgrading from git 2.25 to 2.33 was enough to solve the issue.


Note: as seen here and here, you can also get that cryptic error message when the remote server as a planned (or unplanned?) maintenance.

So don't forget to check GitHub Status, Status GitLab, BitBucket status, or any other remote service you are using for hosting your repositories.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • never change ssh_config, tried set the port manually still the same. I edit the question to include the verbose output – Fazar Sep 02 '21 at 03:19
  • @Fazar Do you have a ~/.ssh/config file? Is there anything regardig ssh in your environment variables (`env|grep -i ssh`)? Would the issue persists with Git 2.33 (after a [ppa upgrade](https://stackoverflow.com/a/41357503/6309))? Is your `~/.ssh/id_rsa.pub` registered to your GitLab user profile SSH setting? – VonC Sep 02 '21 at 06:10
  • @Fazar What changed, for you to accept the answer? – VonC Sep 02 '21 at 06:40
  • oh wow I update my git to 2.33.0 and it worked, thanks for the suggestions. maybe there's some git config I accidentally change and the update just fix that – Fazar Sep 02 '21 at 06:40