How to create a SSH tunnel
By Greg on Tuesday, February 17 2009, 19:49 - Network - Permalink
First of all, this is a small memo for me because I'll need to use this quite often the next weeks. So if it can be usefull for others, I post it here 

- I want to access to a private port on a remote host. This port will be mapped on a local port with the tunnel.
- After creating the tunnel, the service will be accessible on the port localhost:LocalPort
- All the communications will pass trough the SSH connection (so it will be ssl-encrypted)
ssh -f -N -L LocalPort:RemoteHost:RemotePort Login@RemoteHost
- -f is to hide the session
- -N and -L are there for the tunnel



Comments
Short addedum, the -N option is to enable no commands options. without this option, you will get a shell on the remote host, foo free. (-f imply -N)