I had install latest gitlab with docker in 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
and I had changed host ssh port 22 to 10022, let gitlab use 22 port,
gitlab run successful, and it worked on http, but it has error on ssh.
git clone git@git.xxxx.com: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.
And I check 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 had try ssh command in gitlab container, it’s ok. And I also add 22 port into 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 say
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 am searching for a long time on net. But no use. Please help or try to give some ideas how to achieve this