The following created an SSH tunnel from my local desktop port 8181 to a remote server port 8181 on which Squid was running so I could point my browser to local port 8181 and the web browsing traffic would be sent over an encrypted connection:
ssh -f -N -q -L 8181:localhost:8181 email@example.com
- -f tells ssh to go into the background (daemonize).
- -N tells ssh that you don’t want to run a remote command. That is, you only want to forward ports.
- -q tells ssh to be quiet
- -L specifies the port forwarding
For more handy tunnelling commands see: http://www.noah.org/wiki/SSH_tunnel