ssh: connect to host github.com port 22: Connection refused

519 阅读1分钟

本文以Windows系统为例进行说明,使用git命令提交项目,本来一直都用的好好的,今天忽然就提示如下错误ssh: connect to host github.com port 22: Connection refused

原本以为github.com挂了,但是浏览器访问github.com一切正常。

尝试了网上搜索到的解决方案,使用GitHub的443端口解决了我的问题

22端口可能被防火墙屏蔽了,可以尝试连接GitHub的443端口。

在用户目录下的~/.ssh/config中添加如下内容(如果没有config这个文件就新建一个)

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

参考: 坑:ssh: connect to host github.com port 22: Connection refused