Ssh: Connect to Host Github. Com Port 22: Connection Refused
So I Followed the Guide on How to Add a Ssh Key to Github, and Added a New Ssh Key with a Passphrase to Github and the Ssh Agent. Now, If I Run Ssh -T as...
So I followed the guide on how to add a SSH key to GitHub, and added a new SSH key with a passphrase to GitHub and the SSH agent. Now, if I run ssh -T as described in the guide to test if I set everything up correctly, it doesn't even prompt me for my passphrase, but immediately returns ssh: connect to host github.com port 22: Connection refused. I have both openssh-server and openssh-client installed and the SSH service is running.
Help would be appreciated.
UPDATE: When I try and clone a repository which for which I have write access from a friend's GitLab instance, it throws the same error. Seems like this is a problem with SSH, not with the keys. (I have them added to the instance.)
2 Answers
Have you tried using port 443, and adding ssh. subdomain prefix?
This command will test it. You should get an error since a shell is not supported.
ssh -T -p 443
Then you can use a full URL to specify the project path, see Stack Overflow answer for details:
ssh://:443/yourname/reponame.git
If you get a connection refused, it means you actually got a packet back which states that your destination does not accept your connection. This could mean a few things:
github.com is down (not too likely, but you could always check their status on )
you have an invalid IP address for github.com (manual entry in /etc/hosts or your resolver) which blocks ssh from at least your IP address
you have a firewall along the way to github.com which blocks the ssh traffic (eg. local firewall or corporate firewall)