【问题标题】:Сannot access to local gitlab server via SSHСannot 通过 SSH 访问本地 gitlab 服务器
【发布时间】:2020-12-21 15:12:24
【问题描述】:

寻求有关 ssh 访问的帮助

我在本地网络中有一台 centos 7 物理服务器,由 2 台计算机、静态 IP 和带有项目的远程服务器(也是 centos)

centos上安装gitlab,将外部8686端口转发到路由器内部77端口

http 一切正常:

git remote add origin http://123.456.789.101:8686/user/project.git

现在我正在尝试通过 SSH 进行访问

我在远程服务器上使用 ssh-keygen 生成了 .pub 密钥,将其复制到 gitlab 网络界面

现在,当我尝试检查与端口的连接时:

ssh git@123.456.789.101:8686

我收到:“名称或服务未知”错误

没有端口或尝试添加 git@ 远程:

ssh git@123.456.789.101
git remote add origin git@123.456.789.101:8686/user/project.git

我收到:“连接超时”错误

我错过了什么以及它应该如何工作?

【问题讨论】:

    标签: ssh centos gitlab portforwarding


    【解决方案1】:

    您需要查看which port your GitLab is configured to listen to for SSH

    但我怀疑它可能与监听 HTTPS 的端口相同。
    除非你使用alternate SSH connection(但这仅适用于gitlab.com),或者使用一些SSH隧道,如issue 495

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-03-17
      • 1970-01-01
      • 1970-01-01
      • 2021-12-20
      • 2014-12-06
      • 2017-08-11
      • 2020-07-02
      相关资源
      最近更新 更多