Minyoung Chang
Minyoung Chang

Reputation: 21

How to solve this? ssh: connect to host github.com port 22: Connection timed out fatal

whenever I try to run git pull upstream master -X ours I get an error below:

ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

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

I literally followed almost every solution I could find online but nothing has resolved it yet.. Can somebody please help with this? Thanks

Upvotes: 2

Views: 10782

Answers (4)

Rafael
Rafael

Reputation: 5

Maybe the problem is with the version of openSSH and openSSL that you have installed.
Communication with GitHub only works for me with the versions:
OpenSSH_7.6p1, OpenSSL 1.0.2u 20 Dec 2019

View response at:
https://stackoverflow.com/a/78365106/21626873

Upvotes: 0

Khomendra
Khomendra

Reputation: 7

I was facing the same issue. As usual after coding I always push the code. But this time it didn't work. I followed Many tuts to solve this problem. But end up when I realize my VPN was switched ON already. But before that I applied below command:

git remote set-url origin https://github.com/username/repo-name

And it worked.

Upvotes: -2

Sridhara Shetty
Sridhara Shetty

Reputation: 107

For me reconnecting wifi connection and VPN connection solved the issue.

Upvotes: 2

VonC
VonC

Reputation: 1323953

If you are in a corporate environment, outgoing SSH connection would typically be blocked. Or it could be a GFW side-effect (although Hong Kong is supposed to be not impacted).

In any case, the fist tests are to check access and switch to HTTPS, to see if it works then:

  • ping github.com
  • cd /path/to/repo; git remote set-url origin https://github.com/<me>/<myRepo>

Upvotes: 3

Related Questions