Another (unchecked) possibility may be that you are forwarding the connection from the host to the container, adding it to the git user authorized_keys file as such:
command="nc -q0 gitlab 22" ssh-rsa AAAAB....[REST OF YOUR PUBKEY]
The git user must be created on the host machine. now when you connect to "ssh git @host", this connection should be redirected using "nc" to the gitlab container.
Obviously, it is also required that all ssh gitlab keys copied with the command prefix to the host machine
However, this only works if the gitlab container is not on an isolated network, and the host container has the ability to connect to gitlab 22 port.
In my setup, this did not work, since gitlab is on an isolated network, so I ended up gitlab ssh on a different port:
- Run the container using
-p 20022:22 - add
gitlab_rails['gitlab_shell_ssh_port'] = 20022 to the gitlab.rb configuration
Alexander KΓΆb
source share