Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

So, I want to visit a website that only permits access to computers from certain ip domains. My ip is not from one of the allowed domains, but I've ssh'd into a (linux) machine at another location that is at one of the allowed domains.

How do I launch a web browser on my local machine that visits websites through the ip of the remote machine?

share|improve this question
up vote 3 down vote accepted

The SSH tunneling in Clemens' answer will work for one specific website, with caveats... if the site does virtual hosting, where the content depends on your HTTP request pointing at a specific hostname, simple port tunneling won't work. And it will only get you to the one site.

A more robust solution is to use OpenSSH dynamic port forwarding. The command would be:

ssh -D 1080

Next, set the browser on your client to use a SOCKS proxy at, port 1080.

Now, regardless of which site you're visiting, all of your browsing activity (including DNS lookups) will use the remote server.

More detail is here: SSH/OpenSSH/PortForwarding: Dynamic Port Forwarding

If you need to switch frequently between browsing normally and browsing through the remote SSH server, look into installing a plugin for your browser to do fast proxy switching. There are a lot of them.

share|improve this answer

You can use SSH tunneling to build a TCP tunnel from your Client to the SSH server and route your traffic through this tunnel.

If your private IP on the SSH server Side that you want to access is and your ssh server is, you can use a SSH command like this:

ssh -L 8080:

When this ssh connection is established you can point your local browser to http://localhost:8080 and you should see the page that you would have seen when browsing to in the private net.

share|improve this answer
So if I wanted to go to in my browser but (hypothetically) Google only lets people go to that page if they have an IP from, I'd ssh into the computer I know at, log in, then use the ssh command in your answer, open my browser, and go to – Alexander Nikolas Gruber Jun 15 '13 at 22:10
not exactly, you connect to with the command above. Then you would point your browser to http://localhost:8080. But I think the solution provided by Steven is better. I didn't know about this. – Clemens Bergmann Jun 16 '13 at 5:27

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.