ssh: connect to host github.com port 22: Connection timed out
Outbound SSH on port 22 is blocked (firewall, corporate or public Wi-Fi).
Seen on:
Git
Meaning
Many networks block port 22. GitHub and GitLab accept SSH over port 443 on alternate hostnames.
Common causes
- Firewall blocking port 22
- VPN/proxy restrictions
⚡ Quick fix
- Use SSH over 443 (ssh.github.com:443)
- Or use HTTPS with a token
Detailed fix by platform
Git
- bash
# ~/.ssh/config Host github.com Hostname ssh.github.com Port 443 User git
How to diagnose
- Port — Can you reach port 22 elsewhere?
- Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026