51工具盒子

依楼听风雨
笑看云卷云舒,淡观潮起潮落

git push/pull 出现’ssh: connect to host github.com port 22: Connection timed out‘的快速解决方案

前置 {#前置}

本人在执行 git push/pull 时持续报错如下:

|-----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | 1 2 3 4 | ssh: connect to host github.com port 22: Connection timed out fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. |

既然22端口无法连接,那就直接改为443端口。

解决 {#解决}

终端直接编辑ssh配置:

|-----------|----------------------------| | 1 | nano ~/.ssh/config |

加入:

|---------------|----------------------------------------------------------| | 1 2 3 | Host github.com Hostname ssh.github.com Port 443 |

重新执行,ssh应该已经可以正常建立连接。

赞(1)
未经允许不得转载:工具盒子 » git push/pull 出现’ssh: connect to host github.com port 22: Connection timed out‘的快速解决方案