ssh - gitlab 错误连接到主机 gitlab.com 端口 22 : Connection timed out

标签 ssh gitlab

我已将默认 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/

相关文章:

gitlab - 从 GitLab 调用 Webhook 返回 SSL 错误

java - java远程登录Linux系统运行 "grep"

macos - SSH到无法直接访问的远程主机

c++ - 如何让 GitLab Windows 共享运行器构建速度更快?

gitlab - GitLab 的存储库和用户限制是什么

ubuntu - 如何更改 GitLab 中 root 用户的电子邮件?

mysql - 为什么 mysql 通过 ssh 命令不提示输入密码?

linux - nagios 和 ubuntu ssh 身份验证

security - 到 Amazon EC2 的 PostgreSQL SSH 隧道?

Gitlab CI 规则 - 仅在推送到 origin/master 时运行