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

问题描述

$ git clone git@github.com:MaugerWu/MaugerWu.github.io.git
Cloning into 'MaugerWu.github.io'...
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 rigths
and the repository exists.

问题解决

  1. 我的解决办法是将 git@ 换成 https@,将链接 $ git clone git@github.com:MaugerWu/MaugerWu.github.io.git 换成了 $ git clone https://github.com/MaugerWu/MaugerWu.github.io.git,然后就可以了。
  2. 测试连接
    • 首先打开 git Bash,输入命令 ssh -T git@github.com 测试看看是否连接成功。成功会提示 Hi XXX! You've successfully authenticated, but Github does not peovide shell access.
    • 连接超时会提示 ssh:connect to host github.com port 22:Connect timed out
    • 参考:https://cloud.tencent.com/developer/article/1019718
posted @ 2018-11-28 13:54  梦飞扬~  阅读(3390)  评论(0编辑  收藏  举报