GitLab 不监听 ssh 端口

Joh*_*ann 7 ssh port gitlab

我刚刚通过综合在运行 Ubuntu 14.0.4 LTS 的 VPS 上安装了 GitLab CE,对以下内容进行了更改/etc/gitlab/gitlab.rb并重新运行sudo gitlab-ctl reconfigure

gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:8181"
external_url 'https://gitlab.myserver.com/'
gitlab_rails['gitlab_shell_ssh_port'] = 2222
web_server['external_users'] = ['www-data']
nginx['enable'] = false
Run Code Online (Sandbox Code Playgroud)

我的 Apache VirtualHost 配置正在运行,我可以访问 Web 界面https://gitlab.myserver.com/,在那里我已经添加了我的 SSH 密钥,但是当克隆/推送/etc 到或从ssh://git@gitlab.myserver.com:2222/mygroup/myproject.git我收到

ssh: connect to host gitlab.haggi.me port 2222: Connection refused
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
Run Code Online (Sandbox Code Playgroud)

$ ssh -vvv -T -p 2222 gitlab.myserver.com

OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/me/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to gitlab.myserver.com [12.34.56.78] port 2222.
debug1: connect to address 12.34.56.78 port 2222: Connection refused
ssh: connect to host gitlab.myserver.com port 2222: Connection refused
Run Code Online (Sandbox Code Playgroud)

$ netstat -tlpn不列出任何侦听端口 2222 的进程
$ sudo gitlab-rake gitlab:check不产生任何错误或警告(http://pastebin.com/ThCJ0nU7

ufw 中允许使用端口 2222/tcp

Jak*_*uje 9

您需要gitlab_rails['gitlab_shell_ssh_port'] = 2222根据sshd服务器运行的端口设置选项。

如果我是对的,Gitlab 没有运行单独的 ssh 服务器。如果您sshd在标准端口上运行,只需切换到22,重新启动gitlabsshd在标准端口上重试。

如果你坚持在不同的端口上运行,则需要修改也是你sshd_config在你的VPS和潜在的其他东西。