====== Tunneling ====== To use SSH tunnels, you'll need [[http://www.putty.nl/|Putty]] for Windows, [[http://projects.tynsoe.org/en/stm/|SSH Tunnel Manager]] on MacOS X, or the plain //ssh// command on Linux/UNIX. There are also other 3rd party solutions, which may make setting up of SSH tunnel more convenient to you. Also refer to: [[http://discuss.joyent.com/viewtopic.php?id=12449|enabling Tunneling]] FIXME Needs a guide on this (finally) **__With putty:__** * First create you normal SSH connection. * Go to Connection -> SSH -> Tunnels. * Add your ports you like to tunnel. Source port is the port you will use to connect to. Just pick a free port number for this. Destination is the port you want to connect to. This is the destination viewed from you SSH session. (use 127.0.0.1) An example to connect to postgreSQL: * Source port: 4001 * Destination: 127.0.0.1:5432 Don't forget to click on //Add//! Now you connect to 127.0.0.1:4001 on you local machine. **__With Plain Old SSH:__** A command like this works, here's what the options mean. (Here I'm forwarding port 3306, or mysql) ssh -2 -f -c blowfish -N -C @ -L 3307/127.0.0.1/3306 * -s means ssh 2 * -f means fork (run the command in the background) * -c blowfish and -C specify what kind of compression and turn on compression * -N doesn't execute any commands on the remote host * -L localport:localhost:targetport (localport and localhost are where you want the tunnel to terminate, targetport is the port that the tunnel originates at) * and somewhere in there you need to include your server and username.