-1

I've installed GitLab ee on Docker. I'd like to use authentication via ssh instead password but each time I try to authenticate, connection is closed. SSH Port is 1122->22 so I'm connecting with git@gitlab.example -p 1122. I also enabled the port in ufw, checked if openssh server is running in the container.

Error: Connection closed by HOST port 1122

I was searching long time but I didn't find anything so I'll be glad for any suggestion.

β.εηοιτ.βε
  • 33,893
  • 13
  • 69
  • 83
Quaky
  • 1
  • 1

1 Answers1

1

Potential problem with Docker and UFW

Time ago I was wondering how to work with both UFW and Docker together (The GitLab service doesn't seem to be the problem, pretty sure you could have had the same problems with any service at all).

Check out this thread: What is the best practice of docker + ufw under Ubuntu

And also consider this:

To persist the iptables rule install the linux package iptables-persistent according to your server distro, in my case (Debian) is sudo apt install iptables-persistent and the package installation will add the NAT rule to a persistent file which is executed on boot. ~afboteros

Potential problem with Gitlab and Docker

When using Gitlab through Docker, some "heavy port-binded" services like SSH might need you to configure them to the exposed port. Maybe if you set the SSH service to the 1122 as you intended to, and binding it like that on the Dockerfile maybe you could make it work.

Official Gitlab documentation Gitlab configuration