【问题标题】:Github connect to host github.com port 22: Operation timed outGithub 连接到主机 github.com 的 22 端口:操作超时
【发布时间】:2015-09-18 11:01:20
【问题描述】:

我在尝试推送或拉取时突然开始收到以下错误消息:

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.

如何检查我是否拥有“正确的访问权限”?我已经在这个存储库上工作了很长一段时间,从来没有遇到过问题。

我做错了什么?

【问题讨论】:

  • telnet github.com 22 --- 如果你运行它会得到什么?
  • @zerkms 我得到了Operation timed out, Unable to connect to remote host
  • 那是你的连接问题。
  • @zerkms 关于如何解决这个问题的任何想法?
  • 它可以是任何东西:从您的操作系统问题到您的互联网提供商的问题。

标签: git terminal


【解决方案1】:

不知道是否有人仍然需要解决此问题。遇到了同样的问题,我通过下面的链接找到了解决方案。

创建或编辑~/.ssh/config 并附加以下内容:

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

您可以从这里阅读:https://amesbury.it/git/github/2018/05/15/port22-blocked-github.html

【讨论】:

    【解决方案2】:

    我遇到了同样的问题,并通过从 ~/.ssh/known_hosts 文件中删除 github 条目来修复它。

    【讨论】:

      猜你喜欢
      • 2013-03-13
      • 1970-01-01
      • 1970-01-01
      • 2020-08-10
      • 2017-01-22
      • 2017-11-29
      • 1970-01-01
      • 2016-06-04
      相关资源
      最近更新 更多