Surfing the Web using SSH Tunnel

Sometimes, you are connected to an internet which is unknown/insecure such as public WiFi hotspots or you are just surfing the internet at work.  In these type of scenarios you might want to secure your connection so no one can sniff at what or where you’re surfing. One way to create a secure connection is to create an SSH tunnel, and have your web browser use it as a SOCKS proxy.

The first requirement is to have a remote host running an SSH server. e.g. a box at home running OpenSSH. Then, you need to have an SSH client installed on your local machine, for Windows you can use PuTTY.

Establish an SSH tunnel using PuTTY:

Create a new PuTTY session

Run PuTTY and create a new session to connect to the remote host. Fill in the hostname, the port (usually 22), make sure SSH is checked.

PuTTY Session

Configure the Secure Tunnel

Click on “Tunnels” on the left panel to set up dynamic fowarding for a local port. Under “Add new forwarded port” type in the port number (e.g. 4080) for the source port, leave the destination blank, and check Auto and Dynamic. Then click the “Add” button. You should see D4080 listed in the “Forwarded Ports” box.

PuTTY Tunnel

Establish an SSH tunnel on Linux:

Use the following command:

$ ssh -D 4080 username@remote_host_server

The tunnel is created when you login to the SSH server.

Configuring Your Web Browser:

To use the SSH tunnel as a SOCKS proxy you need to change the connection settings in the browser.

In the Firefox Connection Settings:

  • Check “Manual Proxy Configuration:”
  • Fill in 127.0.0.1 for the “SOCKS Host:” and 4080 for “Port:”
  • Check “SOCKS v5″

Firefox Proxy Settings

Once everything is done you are now surfing the web securely.

Related posts:

  1. SSH through HTTP Proxies
  2. Remote Desktop with SSH Tunneling
  3. HTTP Tunnel Through ISA Server
  4. Surfing the Web using Web Proxy
  5. Installing BoutDuTunnel Server on Mono XSP
This entry was posted in Proxy, Security, SSH, Tunnel and tagged , , , . Bookmark the permalink.

One Response to Surfing the Web using SSH Tunnel

  1. Pingback: vincentkong.com » Blog Archive » Surfing the Web using Web Proxy