简体   繁体   中英

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

So I've been getting this error when attempting to clone a repo from my company's network, and I'm assuming there's a firewall blocking the port.

user@host:~/test_dir$ git clone git@github.com:master/migration.git
Cloning into 'migration'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I tested the solution from this post https://stackoverflow.com/a/54191729/4175957 which was to add the following lines to the ~/.ssh/config file:

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

It didn't work. Every answer I try to find says to do the same thing, I haven't found any other workaround.

Any ideas?

I confirm a company network is by default blocking any egress SSH query (to avoid encrypted flux)

I can only use HTTPS URL with github.com in a company environment.
That would therefore be the official workaround.

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