Browser <== secure tunnel ==> ssh server <===> twitter.com Mac OS X Terminal.app, iTerm2 or iSSH.app (GUI, so far iSSH doesn't work under Snow Leopard) Linux Terminal, CLI or PuTTY (plink is better choice). ssh -qTfnN -D 1080 hostname All the added options are for a ssh session that’s used for tunneling. -q be very quiet, we are acting only as a tunnel. -T Do not allocate a pseudo tty, we are only acting a tunnel. -f move the ssh process to background, as we don’t want to interact with this ssh session directly. -N Do not execute remote command. -n redirect standard input to /dev/null. -D Dynamic socks based port forwarding In addition on a slow line you can gain performance by enabling compression with the -C option. Or we can use plink in putty-tools, here is a simple sample which shares the tunnel with all other hosts in the LAN. Linux/Mac OS X plink -C -A -N user@ssh_host -D 0.0.0.0:port Windows plink.exe -C -A -N user@ssh_host -D 0.0.0.0:port It is the same as ticking SSH - Tunnels - Local ports accept connections from other hosts. Others in the same LAN will be able to use this tunnel as well. (Ticking this option will cause connection dropped due to unknown reasons.) Note: -D 0.0.0.0 means to bind with any IP address so that other hosts in the same LAN will be able to use the tunnel. How to surf the Internet via the tunnel (socks5 proxy)? Firefox 7.0^ with Proxy Selector Note: set network.proxy.socks_remote_dns to true, use remote socks5 proxy to lookup DNS to avoid DNS pollution (GFW). Chrome pass the parameter when launching chrome, create a launcher or shortcut Linux in Terminal google-chrome --proxy-server=socks5://localhost:port Mac OS X (doesn't work as expected...) Windows in Command Line Prompt %userprofile%\AppData\Local\Google\Chrome\Application\chrome.exe --proxy-server=socks5://localhost:port Otherwise, use Proxy Switchy! extension to switch proxy settings. Recommended: Extension: Proxy Switchy! References: PuTTY docs http://thinkhole.org/wp/2006/05/10/howto-secure-firefox-and-im-with-putty/ http://lifehacker.com/327066/use-your-iphones-internet-connection-on-your-laptop |