GitLab 没有监听 ssh 端口

GitLab 没有监听 ssh 端口

我刚刚通过 omnibus 在运行 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

我的 Apache VirtualHost 配置正常运行,我可以访问 上的 Web 界面https://gitlab.myserver.com/,我已在其中添加了 SSH 密钥,但在执行克隆/推送/等操作时,我收到ssh://[email protected]:2222/mygroup/myproject.git

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

Please make sure you have the correct access rights
and the repository exists.

$ 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

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

ufw 允许使用端口 2222/tcp

答案1

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

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

如果你坚持在不同的端口上运行,你需要调整还有您的sshd_config以及您的 VPS 上的其他潜在东西。

相关内容