如何透過 gitlab 子網域 URL 進行 ssh

如何透過 gitlab 子網域 URL 進行 ssh

從這個問題我想問更多

https://stackoverflow.com/questions/75527943/unable-to-git-clone-from-self-hosted-gitlab-instance-with-custom-port-6022

解決了需要在雲端服務上開啟連接埠的問題。現在下一個問題是如何使用 URLgitlab.gitlabinstance.com而不是主機 IP 進行複製。例 :

ssh [email protected] -p 6022

x.x.x.x是主機IP並且它可以工作。

我想透過 ssh

ssh [email protected] -p 6022

我得到了這個輸出,其中 IP 位址與主機 IP 不同(zzzz、yyyy、a、a、a、a)

其中z.z.z.z, y.y.y.y,a.a.a.a是公共地址

 ssh -vT gitlab.example.com -p6022
OpenSSH_8.5p1, OpenSSL 1.1.1k  25 Mar 2021
debug1: Reading configuration data /c/Users/Sam/.ssh/config
debug1: /c/Users/Sam/.ssh/config line 1: Applying options for gitlab.example.com
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Connecting to gitlab.example.com [z.z.z.z] port 6022.
debug1: connect to address z.z.z.z port 6022: Connection timed out
debug1: Connecting to gitlab.example.com [y.y.y.y] port 6022.
debug1: connect to address y.y.y.y port 6022: Connection timed out
debug1: Connecting to gitlab.example.com [a:a:a:a] port 6022.
debug1: connect to address a:a:a:aport 6022: Network is unreachable
debug1: Connecting to gitlab.example.com [a:a:a:a] port 6022.
debug1: connect to address 2606:4700:3032::ac43:97fa port 6022: Network is unreachable
ssh: connect to host gitlab.example.com port 6022: Network is unreachable

有什麼解決辦法嗎?

相關內容