jeroenpeeters/docker-ssh

Usage as a reverse ssh tunnel

wikatik opened this issue · 1 comments

Hi,
Firstly, thanks for making this.
I am trying to set up a solution such that my docker container can communicate with the host via ssh. I am trying to do this by connecting from the host to the docker container via ssh, and opening a reverse tunnel.

I have successfully connected to the container from the host via ssh using ssh -p 2022 localhost.

I have created a custom Dockerfile:

FROM jeorenpeeters/docker-ssh

EXPOSE 2222

in hope that the following command from the host would set up a reverse ssh tunnel: ssh -fNT -R 2222:localhost:22 -p 2022 localhost, however I get hit with the Warning: remote port forwarding failed for listen port 2222.

I also have port 2222 exposed on my main docker container, and netstat | grep 2222 shows that port 2222 is not busy.

Is what I am trying to do even possible? I have tried to docker exec -it docker-ssh-test sh into the docker container but I can not find any mention of ssh or sshd.

Any advice would be appreciated.

Hi @wikatik, sorry for the extremely late response to your question.

What you're trying to accomplish is not possible currently with docker-ssh. I only implement some of the ssh functionality. The ssh server executes most ssh commands in the container via the docker exec api.

Port forwarding is not a feature that is currently implemented.