簡體   English   中英

Gitlab SSH 連接超時,但使用 HTTP(S) 工作正常

[英]Gitlab SSH connection is timed out, but using HTTP(S) works fine

提示:SSH 密鑰在我的機器上和 Gitlab 上都完美配置,所以顯然這不是身份驗證問題,而是連接問題。

當我連接到我的 home.network 並嘗試通過 SSH (ssh -v git@gitlab.com)連接到 Gitlab 時,連接超時並失敗。 然后進程嘗試再次連接,現在使用 IPv4,然后連接成功(等待幾分鍾后),這是 output:

OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u  20 Dec 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to gitlab.com [2606:4700:90:0:f22e:fbec:5bed:a9b9] port 22.
debug1: connect to address 2606:4700:90:0:f22e:fbec:5bed:a9b9 port 22: Connection timed out
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.

但是,如果我連接到任何 other.network,則連接成功,結果為 output:

OpenSSH_7.4p1 Debian-10+deb9u7, OpenSSL 1.0.2u  20 Dec 2019
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to gitlab.com [172.65.251.78] port 22.
debug1: Connection established.

顯然這是我的 home.network 或 Gitlab 上的問題,但我已經嘗試了所有方法並嘗試了很多可能的解決方案,但沒有成功。

很感謝任何形式的幫助。

我遇到過同樣的問題。 這是我的網絡。 我嘗試使用http://ipv6now.com.au/pingme.php ping gitlab並且它有效。 當我從本地工作站發出 ping 命令時,它不起作用。 我使用此處找到的說明將工作站更改為更喜歡ipv4,http://sf-alpha.bjgang.org/wordpress/2012/08/linux-prefer-ipv4-over-ipv6-in-dual-stack-environment -and-prevent-problems-when-only-ipv4-exists/ 本質上,我取消注釋並將 /etc/gai.conf 中的行從precedence::ffff:0:0/96 10更改為precedence::ffff:0:0/96 100

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM