How to launch your local browser through a gateway machine

From Planets
Jump to: navigation, search

What this is about

There are cases where you need to launch your browser from your local machine to reach a dedicated webpage, but for security reasons the target webpage requires that it be accessed from a browser on the declared gateway machine. This is however not always the case (some gateway machines are stripped of many softwares, including browsers) and then one needs an alternative...


For the sake of the example: let's assume your account login is "mylogin", your gateway machine is called "gateway" and that you need to connect to "https://www.somewhere.fr"

One way of doing it

  1. On your local machine, edit the network preferences to select "manual host SOCKS" and specify IP "127.0.0.1" and Port "8888"
  2. Launch a terminal from your local machine and connect via ssh to the gateway machine : "ssh -D 8888 mylogin@gateway" and keep it in the background.
  3. In your browser on the local machine you can now access "https://www.somewhere.fr"

The (minor) drawback of this technique is that afterwards you'll probably want to reset your browser network preference back to "automatic" so as to no longer go through the gateway machine.

An alternative way of doing it

  1. launch a terminal on your local machine an run "ssh -L 8888:www.somewhere.fr:443 mylogin@gateway"
  2. In your browser on the local machine head for "https://localhost:8888" and you'll find yourself on "www.somewhere.fr" where you can navigate.