This is really for my own benefit and quick reference. Here is the command to setup a local tunnel to a remote machine using ssh:
ssh -f -L [local-bind-address]:{local-port}:{endpoint-machine}:{endpoint-port} -N user@ssh-host
The options used:
-f – go into background before executing any commands
-L – For port forwarding [bind address:] local port : host : hostport
-N – Don’t run [...]