赞
踩
GitHub 端口默认使用的本机端口为22, 某些情况下如果此端口被占用,就会导致GitHub连接超时错误。
ssh: connect to host github.com port 22: Connection timed out
Windows下可以通过下面的命令,来查看端口占用情况
netstat -ano
可以通过 SSH 命令临时修改端口号为443,测试是否可以连接到GitHub
ssh -T -p 443 git@github.com
如测试可以成功连接,则可以在 .ssh目录下,新建CONFIG文件,指定端口号
- Host github.com
- User git
- Hostname ssh.github.com
- PreferredAuthentications publickey
- IdentityFile ~/.ssh/id_rsa
- Port 443
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。