Monday, September 4, 2017

Firewall Blocked Github: Connection refused

When I am at work, I encountered the following error while attempting to access Github,

ssh: connect to host github.com port 22: Connection refused
This could be the result that the corporate firewall blocked the SSH service (TCP port 22). In this case, we can inform the ssh client to use port 443 instead according to this Stack Overflow post. To do this, we add the following configuration for the ssh client,

cat >> ~/.ssh/config << END

Host github.com
  Hostname ssh.github.com
  Port 443

END
For me to use ssh to connect to Github, the Github official documentation turns out to be very helpful.

No comments:

Post a Comment