$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
测试连接也 timeout
1
2
$ ssh -T [email protected]ssh: connect to host github.com port 22: Connection timed out
但是可以 ping 通 github.com
test 指定 443 可以成功
1
2
3
$ ssh -T -p 443[email protected]Hi xxxx! You've successfully authenticated,
but GitHub does not provide shell access.
如何解决
覆盖 ssh 的配置
1
vim ~/.ssh/config
添加以下内容
1
2
3
Host github.com
Hostname ssh.github.com
Port 443
重新测试一下
1
2
3
$ ssh -T [email protected]Hi xxxxx! You've successfully authenticated, but GitHub does not
provide shell access.