Blog

Thoughts from my daily grind

SSH Git Port 22 - Connection Timeout - Failed Deploys

Posted by Ziyan Junaideen |Published: 05 June 2020 |Category: Code
Default Upload |

Y'day night I was working on some feature refactoring. I reviewed my own code and prepared to deploy to production. That is when I noticed an odd issue. Vlad (yes - like the more familiar Capistrano - some projects use Vlad for code deploy) was failing and running it with --trace showed connecting to git@github.com was timing out.

Then I tried...

deploy@production:~$ ssh -T git@github.com
ssh: connect to host github.com port 22: Connection timed out

My first thought was that it was a Github down time. I have heard some issues with Github since Microsoft acquisition. I gave it 30minutes and tried again just to find that the issue persisted. Then I thought it might be a firewall issue but there were nothing concerning the issue. I then tested with another server and that had no issues. That is when I thought it might be an issue with either Git or SSH.

After some trial and error and some directions in the internet I found the following to work. The config goes to ~/.ssh/config (to the deploy user).

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

And finally things worked out... Wired thing is nothing changed in production. Only change was locally, a MacOS update.

Tags
About the Author

Ziyan Junaideen -

Ziyan is an expert Ruby on Rails web developer with 8 years of experience specializing in SaaS applications. He spends his free time he writes blogs, drawing on his iPad, shoots photos.

Comments