我已将默认 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,但它根本没有改变。
最佳答案
一、gitlab.com
对于 SSH,将始终通过端口 22 访问:gitlab.com
不监听任何其他端口上的 SSH 连接。
其次,这是客户端(您的)问题:端口 22 可能被阻止(防火墙、公司政策、ISP 等)
至少尝试看看 HTTPS 克隆是否有效:
git clone https://gitlab.com/<user>/<repo>
(关于 HTTPS,检查您是否在代理后面,这里 on Windows for instance)
关于ssh - gitlab 错误连接到主机 gitlab.com 端口 22 : Connection timed out,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56810990/