侧边栏壁纸
  • 累计撰写 38 篇文章
  • 累计创建 81 个标签
  • 累计收到 1 条评论

目 录CONTENT

文章目录

github超时[ssh: connect to host github.com port 22: Operation timed out]

小李同学
2024-01-24 / 0 评论 / 0 点赞 / 644 阅读 / 184 字 / 正在检测是否收录...
$ git push

ssh: connect to host github.com port 22: Operation timed out
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
  1. 先测试可用性
    ssh -T -p 443 git@ssh.github.com
    如果出现下面提示说明可用
Hi XXXX! You've successfully authenticated, but GitHub does not provide shell access.

如果出现下面的提示,直接输入yes回车即可

The authenticity of host '[ssh.github.com]:443 ([20.205.243.160]:443)' can't be established.
...
...
Are you sure you want to continue connecting (yes/no/[fingerprint])?
  1. 创建或修改 ~/.ssh/config 加入以下内容
$ vim ~/.ssh/config
Host github.com
Hostname ssh.github.com
Port 443
  1. 再次测试,出现下面信息就说明成功了
    ssh -T git@github.com
Hi XXXX! You've successfully authenticated, but GitHub does not provide shell access.
0

评论区