port 22 timed out 🌿 Git

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

  1. Use SSH over 443 (ssh.github.com:443)
  2. Or use HTTPS with a token

Detailed fix by platform

Git

  1. bash
    # ~/.ssh/config
    Host github.com
      Hostname ssh.github.com
      Port 443
      User git

How to diagnose

  1. Port — Can you reach port 22 elsewhere?
  2. 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.