Ssh – How to set up squid to act as a tunneling proxy to expose a VPN or SSH tunnel

PROXYsshssh-tunneltunnelingvpn

I'd like to set up a tunneling proxy accessible by URL–so, to access bar.com through the tunneling proxy, you'd go to foo.com/bar.com and continue to browse bar.com transparently from there. I can either set up an SSH tunnel or a VPN connection that I'd like to expose. How can I set up squid (or another proxy server) to route requests through an SSH/VPN connection like this?

Best Answer

First, Setup your ssh tunnel

ssh you@yourproxysever -L8080:localhost:8080

Leave this connection running, this assumes that your proxy server is listening on port 8080.

Second, Setup your web browser to use localhost:8080 as its proxy server

The ssh tunnel will forward packets to your proxy server over ssh.