Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"ssh_exchange_identification: read: Connection reset by peer" error when trying to connect to remote repository on git

Tags:

git

github

I'm very new to github, I started using it about two weeks ago. Everything worked perfectly, I was able to push and pull from my remote repository. Today, however, when I tried to pull from it I got this error message:

ssh_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

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

When I try to do anything that connects to my remote github repository (push, pull, fetch, etc), in fact, it gives me back the same error.

When I type in this command: "ssh -T [email protected]", I just get:

ssh_exchange_identification: read: Connection reset by peer

I didn't modify any settings in my repository or in my SSH keys or anything so I have no idea why it stopped working all of a sudden. What could be the problem?

like image 474
forblaze13 Avatar asked Feb 09 '19 23:02

forblaze13


People also ask

What is this Kex_exchange_identification read Connection reset by peer?

It means the remote server closed the Transition Control Protocol (TCP) stream. My experience suggests that your IP on purpose or by accident is blocked by server firewall or DenyHosts.

What is Connection closed by peer?

The error message "Connection reset by peer" appears, if the web services client was waiting for a SOAP response from the remote web services provider and the connection was closed prematurely. One of the most common causes for this error is a firewall in the middle closing the connection.

What is Ssh_exchange_identification?

it means that our server has detected two different source addresses used in this connection request. This can happen if you are behind a proxy server or using a VPN. It can also happen if you are using a mobile device or mobile hotspot for internet connection from the client side.


2 Answers

I had a similar issue recently, I'm not sure whether its exactly the same as I got the connected user by following command.

ssh -T [email protected]

But when I try to push the code to remote repository I got same error.

kex_exchange_identification: read: Connection reset by peer
fatal: Could not read from remote repository.

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

After trying few solutions from the internet without success, I just tried git init and it worked for me. I hope this works only if the connection user has bound correctly.

Try it out Good Luck.. :)

like image 194
Kandy Avatar answered Oct 05 '22 23:10

Kandy


I also had this problem and I was able to fix it by restarting my internet connection.

I was so confused when git bash suddenly gave me that message. I did not do any alteration on my git repositories at all. Restarting my connection fixed it.

like image 39
dhaynamicoGrant Avatar answered Oct 05 '22 23:10

dhaynamicoGrant