6

解决GitHub代码push失败,提示 connect to host github.com port 22

 1 year ago
source link: https://foofish.net/solve-github-spush-failed.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

解决GitHub代码push失败,提示 connect to host github.com port 22

By 刘志军 , 2024-01-23, 分类: 思考

github

发现本地一个托管在GitHub的项目突然没法push代码了,提示: Connection timed out

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

问题出在22端口上,可能是网络环境或者端口问题,可以通过改用443端口来解决

修改文件 ~/.ssh/config ,添加以下内容:

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

这样 SSH 连接时就会通过 443 端口与 ssh.github.com 进行通信,而不是默认的 22 端口。

保存文件重新push代码验证OK

关注公众号「Python之禅」,回复「1024」免费获取Python资源

python之禅

</article


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK