I got fed up with the Great Firewall and so many people are asking me about how to get access to facebook, so I made this howto.
Here is a quick example:
ssh -D 1080 email@example.com
Here is the variant I use which adds compression, and not logging into your server (aka, only forwarding ports). The command also prints out information about what is connecting. I love to see the output that shows all this working which the -vv option provides:
ssh -vv -CND 1080 firstname.lastname@example.org
URL Pattern: *.youtube.com/*
URL Pattern: *.facebook.com/*
URL Pattern: *.twitter.com/*
The setup I run involves the above easy setup, but I used the following autossh-based script I titled, local_ssh_tunnel. I used autossh because it keeps the ssh connection alive through closing/suspending my laptop, dodgy wireless reception and other general bugs that harm one's net connection.
# use proxy to connect to localhost no port 1080
# 1080 is standard port
if [ "$1" != "" ]
AUTOSSH_GATETIME=0 AUTOSSH_PORT=20000 AUTOSSH_DEBUG=1 \
autossh -v -CND 1080 $SERVER
chmod 700 /home/USERNAME/bin/local_ssh_tunnel
Name: BACKGROUND SLST (Second Line SSH/Socks Tunnel)
Command: xterm -e /home/USERNAME/bin/local_ssh_tunnel
Comment: Runs SLST in the background in terminal window
There is already a great guide for setting this all up in windows. I used it yesterday. Just remember to replace the HOSTNAME with your host and to use the port of your choosing. I use 1080 because its the standard port for this operation and generally not restricted for this activity on most systems.
Here is another guide, which is even better, but has pictures. I will merge my steps with this guide now:
ASIDE: Here is also another guide, which is helpful explaining the basic concepts in one page, but blocked by the GFW.
Since Mac OS X is a Unix-based variant you can do the easy steps above. The crucial difference is that many don't know where one might find Mac's terminal in step 1.
Setup a SLST setup not on the command line, but using the SSH Tunnel Manager graphical application. I cannot find a graphical guide to doing this. One of the great things about using AUTOSSH in the Linux/Unix/Generic advanced guide is that it keeps the connection alive through suspend, or internet outtages. There should be an option to keep-alive the connection in the SSH Tunnel Manager.
This HowTo article originally appeared at rejon.org/wiki/IDEA_20090715_Second_Line_SSH_Tunnel and is republished here in modified form under a Creative Commons Attribution 3.0 License