Reputation: 13
I am in the push code:
ssh: connect to host ssh.github.com port 22: Connection refused
error, I find on the Internet, see someone say is to create a config file in ~/.ssh
directory, enter in the config file
Host github.com
User myusername
Hostname ssh.github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/id_rsa
Port 443
but ping github.com
appeared ssh again: connect to host ssh.github.com
port 443: Connection refused error, ask Dachen to tell me the solution
Upvotes: 1
Views: 7103
Reputation: 33033
443 is the SSL port, not the SSH port, so this configuration is definitely incorrect. Remove this configuration file.
UPDATE: It turns out sshing to port 443 on github.com is actually valid, although most servers don't support this, and it may be blocked by your firewall even for github.com - see comment below.
It is unclear from your question whether the error message actually refers to port 22 or port 443, because the question contains two different error messages. If it refers to port 22, it is probably caused by a firewall between you and GitHub, like a firewall at your place of work or study. Use the HTTP URL for the repository instead of the SSH URL.
Upvotes: 5