userdoc:tt-web-browser-proxy

This is an old revision of the document!


Web Browser Proxy via AstLinux

There may be special situations where you would like to virtually make your web browser appear “inside” a remote AstLinux box to access the web interface of a network device. In the old days command line browsers like 'lynx' and 'links' could get a basic task accomplished, but today a modern browser is needed to manage an IP Phone or network switch that is hidden behind the remote AstLinux firewall.

In theory AstLinux VPN's can be configured to access such “hidden” remote web interfaces, but often it is not worth the trouble, or for security or access reasons, some devices may not be directly reachable via the VPN.

Assuming you have SSH access to the remote AstLinux box itself, either directly or via a VPN, you can very easily enable a local SOCKS Proxy on your web browser machine and use SSH to tunnel the proxy to your remote AstLinux box.

The follow example is demonstrated by using Firefox on Mac OS X, but should work with about any modern web browser and an Operating System which supports SSH such as OS X, Linux, ChromeOS (in developer mode), etc. .

Modern SSH commands have built-in support for establishing a local SOCKS server which then can be tunneled to a remote SSH server. The syntax is:

-D Local_Port

where SSH's SOCKS server listens on port “Local_Port”. In our example we use port 5000, but any port larger than 1024 that is not already in use should be fine.

To establish a local SOCKS Proxy, on your Mac in the terminal type:

ssh -D5000 root@pbx

login as normal to the remote AstLinux box “pbx”, leave this session open, make sure you don't see any “bind: Address already in use” after the ssh login message.

Then go to Firefox:

Preferences → Advanced → Network → Connection: “Configure how Firefox connects to the Internet” { Settings… }

Firefox Proxy

Add the “SOCKS Host:” entry for “localhost” and port “5000”. Check “Remote DNS” if you also want DNS proxied.

Click “OK”

Open a new Firefox window, and enter “192.168.101.1” or some unique address as seen by “pbx”. Even http://www.astlinux.org/ should work via the pbx box.

When finished, reverse the process…

Go to Firefox:

Preferences → Advanced → Network → Connection: “Configure how Firefox connects to the Internet” { Settings… }

Select “No proxy” and Click “OK”

Go to Terminal:

Type “exit”, it should exit immediately, but if there are SOCKS sessions still active it may take a minute but will eventually exit by itself.

  • userdoc/tt-web-browser-proxy.1438185703.txt.gz
  • Last modified: 2015/07/29 11:01
  • by abelbeck