大网数据广告活动
服务器运维问答

GitLab not listening on ssh port

· 52CE 我爱测

I've just installed GitLab CE on my VPS running Ubuntu 14.0.4 LTS via omnibus, made the following changes to /etc/gitlab/gitlab.rb and re-ran sudo gitlab-ctl reconfigure : gitlab_workhorse['listen_network'] = "tcp" gitlab_workhor…

问题原文

原帖链接 · Johannes Trümpelmann · CC BY-SA 4.0

I've just installed GitLab CE on my VPS running Ubuntu 14.0.4 LTS via omnibus, made the following changes to /etc/gitlab/gitlab.rb and re-ran 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

My Apache VirtualHost configuration is working and I can access the web interface on https://gitlab.myserver.com/, where I've added my SSH key, but when cloning/pushing/etc to or from ssh://[email omitted]:2222/mygroup/myproject.git I receive

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 does not list any process listening on port 2222
$ sudo gitlab-rake gitlab:check does not produce any errors or warnings (http://pastebin.com/ThCJ0nU7)

Port 2222/tcp is allowed in ufw

已采纳解答

原帖链接 · Jakuje · CC BY-SA 4.0

You need to to set up option gitlab_rails['gitlab_shell_ssh_port'] = 2222 based on the port where is your sshd server running.

Gitlab is not running separate ssh server, if I am right. If you run sshd on standard port, just swap to 22, restart gitlab and sshd and try again on standard port.

If you insist on running on different port, you need to modify also your sshd_config and potentially other stuff on your VPS.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2015-12-16)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 4.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。