Docker for SSH server used in reverse port forwarding – Digitalmunition

Home Forums Docker for SSH server used in reverse port forwarding

This topic contains 1 reply, has 2 voices, and was last updated by  xamox 1 week, 3 days ago.

  • Author
  • #381137



    I’m looking for a simple docker ssh server used in ssh tunnel for reverse port forwarding. I would like that ssh server to be as simple as possible and only doing the port forward, no shell is needed.

    Just to be sure to be understood, here’s the setup exactly.

    Client is opening an ssh connection using something like this:

    **# autossh -M 4522 -N -f -o “PubkeyAuthentication=yes” -o “PasswordAuthentication=no” -i /home/user/.ssh/id_rsa -o “ServerAliveInterval 30” -o “ServerAliveCountMax 3” -R 4422:localhost:22 [email protected]_ssh_server -p23334**

    So the client, outside of my network connects to my ssh server on port 23334 and opens a local port on ssh server, 4422, that forwards to HIS localhost on port 22.

    So when i connect to port 4422 on my server, i’m forwarded through the ssh tunnel and finally on the port 22 of the ssh client.

    Now, what I would like is using a docker container instead of using my own ssh server.
    Also, i would like the user to not being able to get a shell, but still being able to open a local port for the forwarding.

    Hope i’m clear enough, sorry if it seems confusing 😉

    EDIT: Formating

  • #381138


    I think you may just want -T option:
    `-T Disable pseudo-terminal allocation`

You must be logged in to reply to this topic.