Git over SSH blocked on public WiFi? Try port 443

Some public networks (libraries, hotels, offices) block SSH's default port 22, which breaks git push/pull to GitHub.

GitHub supports SSH over port 443 as a workaround. Test it first:

ssh -T -p 443 [email protected]

If you see Hi <username>!, it works. Update your repo's remote URL:

git remote set-url origin ssh://[email protected]:443/your-username/your-repo.git

Then git push as normal.

Want this permanently? Add to ~/.ssh/config:

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

This transparently redirects all GitHub SSH traffic to port 443 — no need to change remote URLs in any of your repos.

Comments

  1. Markdown is allowed. HTML tags allowed: <strong>, <em>, <blockquote>, <code>, <pre>, <a>.