I am having a weird problem with this container. I know it is specific to gitlab so I’m not sure how much experience you might have with that, but I don’t know if it is a problem with a docker config file or what.
So, I have a gitlab-ce container, and I am trying to be able to connect via SSH (to push and pull to repos). I have port 2222 on my host machine mapped to port 22 on the container. I’ve logged into the container while it was running and verified that the sshd daemon was running, as well as permissions to .ssh/authorized_hosts and related files. Everything should be working fine. But, when I try to login from my desktop, to git@ip:2222, it gives me the error Connection reset by <IP>
.
Weird part is, I can connect just fine if I try to SSH from the docker host into the container. This works with the container’s local IP, the host machine’s domain name, and the host machine’s public IP.
This is running on an AWS instance, so I have verified that the security-group allows for port 2222, and I have also completely flushed iptables so there are no ports being blocked by the host.
WEIRDER PART When I am on my desktop, and I run nc <IP> 2222
, what do I get? Oh yes, SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.1
a nice SSH banner. So, my desktop can definitely see the sshd service running inside the container!
I am just completely baffled by this, and I’ve been trying various stuff around the internet all day and I am really hoping someone here can point me in the right direction.
If you need me to post any configuration files or logs, let me know and I’ll add them!