2

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?

Phillip
  • 43
  • 1
  • 12
  • Is a proper ssh key added to your github account ? Did the clone work previously ? – Asif Kamran Malick Jul 13 '22 at 19:37
  • 3
    Check with your company's IT people before trying to work around it -- there may be good reasons for connections to be blocked, and working around them may create a security problem. – Gordon Davisson Jul 13 '22 at 19:51
  • 1
    You have a networking issue (can't reach GitHub from your system), for which StackOverflow is the wrong forum. However, as @GordonDavisson notes, there may be a corporate reason to restrict network access, so it's a good idea to check that first. – torek Jul 14 '22 at 04:12

1 Answers1

2

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.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Different companies (and sometimes even different parts of the same company) have different policies, firewall configurations, etc. What works in your company doesn't necessarily have anything to do with what works in anyone else's company. – Gordon Davisson Jul 14 '22 at 22:51