我已经将默认的ssh端口从22更改为2233,但是当我想通过ssh从gitlab克隆项目时,它不起作用。
ssh: connect to host gitlab.com port 22: Connection timed out
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
编辑:我也将2233更改为22,但它完全没有改变。
最佳答案
首先,在使用SSH时,始终会通过端口22访问gitlab.com
:gitlab.com
不会在其他任何端口上侦听SSH连接。
其次,这是一个客户端(您)问题:端口22可能被阻止(防火墙,公司策略,ISP等)
至少尝试看看HTTPS克隆是否可以工作:
git clone https://gitlab.com/<user>/<repo>
(关于HTTPS,请检查您是否位于代理后面,此处为on Windows for instance)
关于ssh - gitlab错误连接到主机gitlab.com端口22:连接超时,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/56810990/