I'm using Docker on my Mac OSX.
I have a container with an open ssh
daemon, listening to port 22
.
The virtual machine is set to forward all traffic of port 2022
of the machine to this container 22
port.
I want to set my localhost to forward all 2022
traffic to the machine 2022
port.
My machine runs at 192.168.99.100
I already forwarded all the HTTP traffic at localhost port 8080 to the machine using Apache virtual host configuration and Proxy.
What is the right way to do the same for ssh?
I think it involve SSH Tunnelling as mentioned here but I don't understand how I can set that my localhost will always forward ssh connections from localhost:2022
to 192.168.99.100:2022
p.s. I know docker container should not have SSH installed, but I need it for testing proposes.