How to Browsing the Web Using SSH Tunnel


Sometimes you need to configure something on your client office (router/firewall), but the only way to do that was to be on the their internal network and browse to it using a browser. Trying text based browsers didn’t work, the only way to access and administer the router was to use a full featured browser from behind the firewall itself. There was a DMZ linux machine that I could SSH to, but no VPN available. I figured out how to do it using Putty and Firefox, and this is how you do it.

What you need?

  1. Putty
  2. Firefox browser.

Configure SSH tunnel using Putty

Open Putty and Enter the hostname or IP of the machine you want to establish a remote connection to.  Next under Connection->SSH->Tunnels find the radio boxes under the Destination field and make sure Dynamic is selected.  Next under where it reads Add new forwarded port: enter a source port.  For this example lets use 696, enter this in the source port field and click the Add button.  You should see a value in the Forwarded ports: list that reads D696.  That’s all there is to the Putty side of things.  Next go back to the session area and save the current configuration as a saved session if you’d like, then Open the SSH connection.

Configure Firefox

Launch Firefox, select Tools->Options and click the Advanced tab. Within the Advanced tab, click on the Network tab and click the Settings button.

Within the Network Settings dialog, select the Manual proxy configuration radio button and enter the following for the SOCKS Host: and Port:

SOCKS Host: localhost
SOCKS Port: 696

Click OK on the Settings dialog, then Click OK on the Options dialog. Now you should be good to go.  Enter a new URL in the Firefox address bar and you’ll be browsing from the remote end of the SSH connection.



This entry was posted in Browser, Linux, UNIX and tagged , , . Bookmark the permalink.