simple ssh tunnel for web browsing without proxy settings ?

cbyunta88

n00b
Joined
Sep 22, 2011
Messages
35
Can I set up a simple ssh tunnel on localhost, and tunnel my web browsing through it, without going into proxy/socks settings in the browser ?

Most ssh tunnel examples look like:

ssh -D 8080 -f -C -q -N myuser@remote_ssh_server

... and then you go to browser settings and tell it to use a proxy at port 8080.

But what if I set the tunnel to run on port 80 - shouldn't the browser just run over the tunnel without having to configure anything ?

I tried it:

ssh -f -N -q -L 80:localhost:80 [email protected]

... but it doesn't seem to work ... chrome is still connecting to websites using my local IP, and not example.com ...

Is this not possible ?
 
No, because you're just configuring the listen port, whether that's 8080, or 80 doesn't matter. You still need to point your browser to localhost in order to use the tunnel.

One way to do it would be to point the traffic to a destination site, instead of the remote proxy server, then browsing to http://localhost would take you to that one site instead, but it's limited to one site at a time unless you use a handful of ports to get to each specific site you want.
 
... it turns out that sshuttle is what I want. Global proxy over SSH for all connections (well, all TCP + DNS) and you don't have to configure individual apps, like your browser.
 
Do you access the tunnel from lot of different machines or only a few ones? If it's only a few you could setup OpenVPN. Otherewise SSH tunnels are MUCH easier to setup if it's something you do on all sorts of different machines, especially if you don't have admin right.

What you could do is find a proxy php script, something like hidemyass but that you can host yourself. Set it up on a home server and when you do a SSH tunnel you browse to that. Ex: http://localhost:8080. Then from there you can type in whatever url you want to access. It's not a "true" proxy but it may work.
 
Back
Top