`ssh: connect to host github.com port 22: Connection timed out` on a corporate or hotel network.
IntermediateTroubleshootingAuthentication and Remote Access
Answer
Likely causes → Outbound port 22 is blocked by a firewall.
Diagnose →
nc -vz github.com 22
nc -vz ssh.github.com 443
Fix → GitHub accepts SSH on port 443 via ssh.github.com. In ~/.ssh/config:
Host github.com
Hostname ssh.github.com
Port 443
User git
Verify with ssh -T [email protected].
Prevent → Commit this snippet to your team's setup guide for restricted networks.
More on Authentication and Remote Access
`[email protected]: Permission denied (publickey).` followed by `fatal: Could not read from remote repository.`Beginner`remote: Support for password authentication was removed on August 13, 2021.`Beginner`fatal: Authentication failed for 'https://github.com/org/repo.git/'` with a token that worked last month.Beginner`WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!` when connecting to GitHub over SSH.Intermediate`remote: Repository not found.` for a repo you can open in the browser.Beginner`ssh -T [email protected]` says "Hi someone-else!" but you need your work account.Intermediate