Sometimes I need to make a tunnel through a SSH-server if I’m unable to reach a service beyond the LAN. That’s a SSH-tunnel (clever name!). Actually I’m often having problems remember which arguments to pass to the SSH-client, so just a little reminder to myself. I naturally hope that it can help someone else, too:
1 | ssh user@ssh-server -L local-port-to-bind-to:host-to-reach:the-port-on-the-host |
Or maybe in a more readable format:
1 | ssh user@ssh-server -L x:y:z |
where
x = the local port to bind the tunnel to
y = the host that should be at the other end of the tunnel, so to speak
z = the port on the host
