I've installed the latest gitlab using docker on centos 7
docker run -d --hostname git.xxxx.com \
-p 8082:80 -p 22:22 \
--name gitlab \
--restart always \
-v /srv/gitlab/config:/etc/gitlab:Z \
-v /srv/gitlab/logs:/var/log/gitlab:Z \
-v /srv/gitlab/data:/var/opt/gitlab:Z \
gitlab/gitlab-ce:latest
I also changed the host ssh port to 10022 and let gitlab use port 22. Gitlab ran successful. Cloning worked using http but fails when using ssh.
git clone [email protected]:yphc/dt-dd-miniprogram.git
Cloning into 'dt-dd-miniprogram'...
ssh: connect to host git.xxxx.com port 22: Bad file number
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Output from checking Gitlab status:
root@git:/# gitlab-ctl status
run: gitaly: (pid 472) 241405s; run: log: (pid 467) 241405s
run: gitlab-monitor: (pid 474) 241405s; run: log: (pid 465) 241405s
run: gitlab-workhorse: (pid 471) 241405s; run: log: (pid 464) 241405s
run: logrotate: (pid 15611) 203s; run: log: (pid 456) 241405s
run: nginx: (pid 475) 241405s; run: log: (pid 469) 241405s
run: node-exporter: (pid 460) 241406s; run: log: (pid 459) 241406s
run: postgres-exporter: (pid 453) 241406s; run: log: (pid 452) 241406s
run: postgresql: (pid 470) 241406s; run: log: (pid 463) 241406s
run: prometheus: (pid 482) 241406s; run: log: (pid 476) 241406s
run: redis: (pid 396) 241408s; run: log: (pid 395) 241408s
run: redis-exporter: (pid 455) 241406s; run: log: (pid 454) 241406s
run: sidekiq: (pid 473) 241406s; run: log: (pid 468) 241406s
warning: sshd: unable to open supervise/ok: access denied
run: unicorn: (pid 466) 241406s; run: log: (pid 458) 241406s
warning: sshd: unable to open supervise/ok: access denied
I tried the ssh command in the gitlab container which worked. I also added port 22 to the firewall.
[root@localhost zones]# firewall-cmd --list-all
public (active)
target: default
icmp-block-inversion: no
interfaces: enp2s0
sources:
services: ssh dhcpv6-client
ports: 2022/tcp 10022/tcp 22/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
And when I close firewall it says
Cloning into 'dt-dd-miniprogram'...
ssh_exchange_identification: Connection closed by remote host
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I looked around on the internet for a long time but couldn't find anything. I'd be grateful for any help or ideas on how to solve this.