(via embraceubuntu.com)
$ ssh -D 9999 username@ip-address-of-ssh-server
This will create a SOCKS proxy on port “9999″ of your computer (localhost). This is a secure tunnel to the server. Now all you have to do is set the preference in Firefox to use a SOCKS proxy. The proxy is, “localhost”, with the port 9999.