SSH port forwarding in Docker SSH port forwarding in Docker docker docker

SSH port forwarding in Docker


I found the correct SSH port forwarding command

$> ssh root@mongo -L 27017:localhost:27017 -Nf

Normally the idea with this command is that you map a non-public port - through a public server to you own server/compute.

* `root@mongo` - the public server* -L <port on your server>:<third server address>:<port>* `-Nf` - Do not login

Because the public server and third server are the same computer/container you have to use localhost :)