【问题标题】:ssh -vvvT git@github.com is sometimes stuck on debug1: Connecting to github.com port 22ssh -vvvT git@github.com 有时卡在 debug1: Connecting to github.com port 22
【发布时间】:2020-07-25 02:20:53
【问题描述】:

当我尝试通过 ssh 连接到 github 时,有时会卡在 debug1: Connecting to github.com port 22. 上,当我尝试将 git push 连接到 github 时也会发生同样的情况。问题是有时我会建立联系,但很少。也许在 30 次尝试中我能成功一次。

我尝试了不同的端口,没有任何改善。我检查了 git config,似乎很好。

我的 .ssh/config

Host *
  AddKeysToAgent yes
  UseKeychain yes
  IdentityFile ~/.ssh/id_rsa

我的 etc/ssh/config

# lots of uncommented lines... then line 48:    
Host *
  SendEnv LANG LC_*

ssh -vvvT git@github.com的输出

OpenSSH_7.9p1, LibreSSL 2.7.3
debug1: Reading configuration data /Users/alucca/.ssh/config
debug1: /Users/alucca/.ssh/config line 1: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 48: Applying options for *
debug1: Connecting to github.com port 22.

感谢您的任何建议。

【问题讨论】:

  • 听起来你的 SSH 客户端不好。

标签: git github ssh


【解决方案1】:

假设您无法使用 HTTP URL,您可以尝试查看 using Using SSH over the HTTPS port 是否适合您的情况。

ssh -T -p 443 git@ssh.github.com

如果可行,您可以添加到您的~/.ssh/config

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

【讨论】:

  • 谢谢,但问题和以前一样:我有时会连接上,但下次连接到debug1: Connecting to ssh.github.com port 443.
  • @Tococorocko 使用 HTTPS URL 克隆 GitHub 存储库有效吗?
  • @Tococorocko 你也在 Windows 上(它有自己的 OpenSSH,如github.com/PowerShell/Win32-OpenSSH/issues/1334)?
  • git clone https://github.com/username/anyrepo.git 工作正常。我在 Mac 上。
猜你喜欢
  • 2019-02-18
  • 2021-04-26
  • 1970-01-01
  • 2013-03-13
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2022-01-10
相关资源
最近更新 更多