This guide will explain how to create a SSH tunnel to use with Firefox. Creating an SSH tunnel will create an encrypted connection to an outside machine to visit websites that may be inaccessible from a specific location. (Work, School, etc.) If my web site gets blocked at some point, it will probably be because of this article. The idea of this is not exactly to circumvent filters, but it works perfectly for that too.
Part 1: Create an SSH Tunnel
Unix / Linux / OS X:
- In the terminal type:
$ ssh <SERVER> -D <PORTNUMBER> -l <USERNAME> -C
With the above command, <SERVER> is the remote server running the SSH service you will be using to create the tunnel. <PORTNUMBER> is any number between 1025 and 65535, and <USERNAME> is the username you will be using to connect to the remote server. After issuing that command, if you don’t get any errors, jump to Part 2.
Windows:
- Download PuTTY.
- Launch PuTTY. On the initial screen, enter the remote address of the server you will be connecting to in the “Host Name (or IP address)” field.
- In the ‘Category’ list, expand the ‘SSH’ option, and select ‘Tunnels’.
- In the ‘Source port’ field, type in any number between 1025 and 65535. Select ‘Dynamic’ under the ‘Destination’ field, and click on the ‘Add’ button.
- Click ‘Open’ at the bottom of the window to start the connection.
- A new window will open up and prompt you for your user credentials. Enter your username and password. While entering your password, nothing will show up on the screen.
- After submitting your credentials, if you don’t get any errors, you should be successfully connected to the remote SSH server.
Part 2: Configure Firefox
- First of all, if you don’t have Firefox, go to GetFirefox.com and download yourself a copy of it. If you are on a Windows machine that is not your own, consider grabbing yourself a copy of Portable Firefox for this guide and throwing it on a flash drive.
- After your copy of Firefox is up and running, whether it be Firefox or Portable Firefox, it’s time to install FoxyProxy. Add the add-on to Firefox, and restart Firefox when asked.
- Launch the FoxyProxy options. From the ‘Tools’ menu, hover over FoxyProxy and jump down to ‘Options’. From the status bar, right click on the FoxyProxy icon, and select ‘Options.’
- Click the “Add New Proxy” button.
- A new window will appear. “Proxy Details” will be the tab initially selected. If not already selected, select “Manual Proxy Configuration”. In the “Host or IP Address” field, enter ‘127.0.0.1’ and in the ‘Port’ field, enter the port number you used in Part 1. Make sure the check box for “SOCKS proxy” is checked. We will be using “SOCKS v5,” so select that.
- Click on the ‘General’ tab, and in the “Proxy Name” field, give the proxy a name that summarizes what this proxy will do for you, or where it will connect you to. You could even keep it as generic as “SSH Tunnel.”
- Click the “OK” button in the “Proxy Settings” window. You will be prompted with a message about not adding any web addresses to the domain white-list. That’s fine, just click “OK” again. Once back on the main “FoxyProxy Options” window, just click the ‘Close’ button to close it.
- Time to activate the proxy. From the ‘Tools’ menu, hover over FoxyProxy and select “Use Proxy <PROXYNAME> for all URLs.” From the status bar, right click on the FoxyProxy icon, and select “Use Proxy <PROXYNAME> for all URLs.”
- At this point, any web site you visit will be proxied through your SSH tunnel. If something is not working for you, go back and check all of your settings from Part 1 and 2.
- When you are finished using your proxy, be sure to disable FoxyProxy. If you don’t disable FoxyProxy and your connection from Part 1 is not running in the background, your connection to the internet is going to appear dead. To do so, from the ‘Tools’ menu, hover over FoxyProxy and select “Completely disable FoxyProxy.” From the status bar, right click on the FoxyProxy icon, and select “Completely disable FoxyProxy.”