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


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM