Skip to content

Instantly share code, notes, and snippets.

@1solation
Last active September 29, 2022 17:39
Show Gist options
  • Save 1solation/c9407fdc14e3dea023647c589c0fc106 to your computer and use it in GitHub Desktop.
Save 1solation/c9407fdc14e3dea023647c589c0fc106 to your computer and use it in GitHub Desktop.
fix macbook ssh to github timeout issue

% ssh -T git@github.com

ssh: connect to host github.com port 22: Operation timed out

% vi ~/.ssh/config

add the following to the config file

# allows git ssh
Host github.com
Hostname ssh.github.com
Port 443

then try the following

% ssh -T -p 443 git@ssh.github.com

Hi 1solation! You've successfully authenticated, but GitHub does not provide shell access.

@1solation
Copy link
Author

initially created for M1 macbook, problem occurs on intel MacBook also. updating title & description to remove M1 as it isn't M1 specific.

@1solation
Copy link
Author

1solation commented Sep 29, 2022

follow the usual guide on GitHub docs to initially generate a new SSH key and then add said new key to GitHub first. Then apply this fix if you're getting the ssh: connect to host github.com port 22: Operation timed out error

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment