简体   繁体   中英

ssh: connect to host ssh.github.com port 443: Connection refused

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM