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

You are getting ‘ssh: connect to host github.com port 22’ this error because you have a firewall along the way to github.com which blocks the ssh traffic (eg. local firewall or corporate firewall).
The reason could be the firewall modification as you are under a network.(In which case they may deliberately block SSH 443 port).
To doubal check go to your git repository directories… do
1 |
ssh -T git@github.com |
this should timeout. If yes that means your network firewall blocks the ssh traffic.
{Read:- 5 Ways to Improve SEO on Your WordPress Site }
To Fix ‘ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository’ issue follow the below steps.
Go to your git repository directories …do
1 |
git config --local -e |
1 2 3 4 5 6 7 8 9 10 11 12 13 |
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = git@github.com:your-repo-name/your-repo-name.git fetch = +refs/heads/*:refs/remotes/origin/* [branch "develop"] remote = origin merge = refs/heads/develop |
Change entry of
1 |
url = git@github.com:your-repo-name/your-repo-name.git |
To
1 |
url = https://github.com/your-repo-name/your-repo-name.git |
Save and exit.
now try you git command i.e git pull, Hope it’s work!
{Read:- How to Build a WordPress Site in 1 Day }
in some of the cases where your organization has enabled or enforced SAML SSO, you might get below issue.
“remote: The `your-repo-name’ organization has enabled or enforced SAML SSO. To access remote: this repository,
visit https://github.com/orgs/your-repo-name/sso? authorization_request=YOUR_KEY
remote: and try your request again. fatal: unable to access ‘https://github.com/your-repo-name/your-repo-name.git/’: The requested URL returned error: 403″
To fixed this isse just open the above url (copy your url).
https://github.com/orgs/your-repo-name/sso?authorization_request=YOUR_KEY
now try your git command.
{Read:- 10 WordPress Mistakes to Avoid }
Still you are facing any issue drop a comment!