繁体   English   中英

ssh:连接到主机 gist.github.com 端口 22:操作超时致命:无法从远程存储库读取

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

我正在尝试将一些代码推送到要点。 我知道还有很多其他人有类似的问题,我已经查看了我能找到的所有其他帖子,但它们似乎没有解决我的问题。

➜  streamgraph git:(master) git push
ssh: connect to host gist.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.

大多数人都认为这是 ssh 的问题。 但是,我经历了一个漫长的过程,以确保我的 ssh 密钥已更新,并且在测试 ssh 时收到此消息,据我所知,这意味着我的 ssh 设置没有问题。

➜  streamgraph git:(master) ssh -T git@github.com
Hi adrianturcato! You've successfully authenticated, but GitHub does not provide shell access.

最后一点,git 命令在当天早些时候工作,然后突然停止工作。 也有一段时间我会运行 git 命令它不起作用,然后我再次运行它,它会起作用。 但是现在在过去的 24 小时内它一直没有工作。

这是互联网连接的问题还是 github 服务器的问题?

看起来像要点站点的问题:

$ tcptraceroute gist.github.com 22
Running:
        traceroute -T -O info -p 22 gist.github.com 
traceroute to gist.github.com (140.82.112.19), 30 hops max, 52 byte packets
 1  iskra (192.168.3.8)  0.165 ms  0.129 ms  0.125 ms
 2  10.110.23.1 (10.110.23.1)  0.503 ms  0.507 ms  0.516 ms
 3  * * *
 4  * * *
 5  10.110.2.57 (10.110.2.57)  0.460 ms  0.450 ms  0.453 ms
 6  10.110.2.62 (10.110.2.62)  0.665 ms  0.961 ms  0.981 ms
 7  msk-m9-b1-ae24-vlan384.fiord.net (62.140.243.190)  1.924 ms  1.719 ms  1.672 ms
 8  frankfurt-anc-b1-xe0-0-0.fiord.net (93.191.9.155)  38.784 ms  38.897 ms  38.876 ms
 9  xe-1-2-0.mpr1.fra4.de.above.net (80.81.194.26)  45.810 ms  45.815 ms  45.803 ms
10  ae27.cs1.fra9.de.eth.zayo.com (64.125.30.254)  120.960 ms  120.947 ms  120.935 ms
11  ae0.cs1.fra6.de.eth.zayo.com (64.125.29.54)  120.357 ms  120.360 ms  120.349 ms
12  ae2.cs1.ams17.nl.eth.zayo.com (64.125.29.59)  120.819 ms  120.840 ms  121.033 ms
13  ae0.cs1.ams10.nl.eth.zayo.com (64.125.29.80)  120.691 ms  120.688 ms  120.542 ms
14  ae2.cs1.lhr15.uk.eth.zayo.com (64.125.29.17)  120.475 ms  121.397 ms  121.351 ms
15  ae0.cs3.lhr11.uk.eth.zayo.com (64.125.29.118)  121.067 ms * *
16  ae5.cs3.lga5.us.eth.zayo.com (64.125.29.126)  121.503 ms  121.455 ms  121.468 ms
17  ae4.cs1.dca2.us.eth.zayo.com (64.125.29.203)  123.446 ms  123.452 ms  123.442 ms
18  * * *
19  * * *
20  * * *
21  * * *
22  * * *
23  *^C

$ tcptraceroute github.com 22
Running:
        traceroute -T -O info -p 22 github.com 
traceroute to github.com (140.82.118.3), 30 hops max, 52 byte packets
 1  iskra (192.168.3.8)  0.231 ms  0.162 ms  0.130 ms
 2  10.110.23.1 (10.110.23.1)  0.764 ms  0.753 ms  0.732 ms
 3  * * *
 4  * * *
 5  10.110.2.57 (10.110.2.57)  0.554 ms  0.543 ms  0.532 ms
 6  10.110.2.62 (10.110.2.62)  0.770 ms  0.683 ms  0.680 ms
 7  msk-m9-b1-ae24-vlan384.fiord.net (62.140.243.190)  7.158 ms  5.887 ms  5.854 ms
 8  frankfurt-anc-b1-xe0-0-0.fiord.net (93.191.9.155)  38.948 ms  38.872 ms  38.923 ms
 9  ffm-b1-link.telia.net (62.115.63.109)  42.455 ms  42.460 ms  42.450 ms
10  github-ic-350972-ffm-b1.c.telia.net (62.115.182.171)  44.401 ms  44.159 ms  44.354 ms
11  * * *
12  * * *
13  lb-140-82-118-3-ams.github.com (140.82.118.3) <syn,ack>  42.949 ms  43.084 ms  43.025 ms

$ ssh -T git@github.com
debug1: multiplexing control connection
debug1: channel 1: new [mux-control]
debug1: channel 2: new [client-session]
debug1: Sending environment.
debug1: Sending env LC_CTYPE = ru_RU.KOI8-R
debug1: Sending env LC_COLLATE = ru_RU.KOI8-R
debug1: Sending env LANG = C
debug1: client_input_channel_req: channel 2 rtype exit-status reply 0
Hi phdru! You've successfully authenticated, but GitHub does not provide shell access.
debug1: channel 2: free: client-session, nchannels 3
debug1: channel 1: free: mux-control, nchannels 2

$ ssh -Tv git@gist.github.com
OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u  20 Dec 2019
debug1: Reading configuration data /home/phd/.ssh/config
debug1: /home/phd/.ssh/config line 68: Applying options for *
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/home/phd/.ssh/controls/git@gist.github.com:22" does not exist
debug1: Connecting to gist.github.com [140.82.112.20] port 22.
(…timeout…)

使用https://协议。

所以看起来这实际上是 gits SSH gist 服务器的错误。

虽然这有效:

streamgraph git:(master) ssh -T git@github.com
Hi adrianturcato! You've successfully authenticated, but GitHub does not provide shell access.

这超时:

streamgraph git:(master) ssh -T git@gist.github.com

我是如何解决这个问题的:

我更改了终端中的 git 配置文件以强制它使用 HTTPS:

git config --global url."https://gist.github.com/".insteadOf git@gist.github.com
git config --global url."https://".insteadOf git://

您始终可以使用以下方法更改此设置:

git config --global --edit

但这仍然不起作用,因为我的 github 有 2fa。 所以我又创建了一个 github 账号,暂时使用。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM