Small SSH reference
Encripting X session
$ ssh -X hostname
Port forwarding
$ ssh -f -N -L <local port>:localhost:<remote port> username@remote-hostname
Port forwarding (with gateway)
$ ssh -f -N -L <local port>:remote-hostname:<remote port> username@gateway
Port forwarding (reverse forwarding)
$ ssh -F -N -R <remote port>:remote-hostname:<local port> remote-hostname
Dinamic port forwarding (with tsock)
$ ssh -D <local port> username@remote-host
$ tsocks <app> [1]
[1] tsocks must be configured to use the port specified by ssh.