3

There are three machines involved.

Home PC Gateway Server Squid Proxy Server on a workstation. I want to surf internet using the Squid proxy server on my Home PC

I don't have a direct access to the squid proxy server on PC-3(workstation) but I have ssh access to the Gateway server and Gateway server has access to the squid proxy server.

So I want to direct all the web traffic from my home pc to squid proxy server on the workstation via the gateway server.

NOTE- I don't have the sudo access on gateway server.

SSH as socks proxy through multiple hosts

This link tells how to connect to a third pc but in my case I want to connect to a proxy server.

1 Answers1

1

You do not need to use SOCKS proxy to connect to a HTTP proxy through SSH. You can use the following command:

ssh -f -N -L $portlocal:$machineproxy:$portproxy $machinegateway
  • $portlocal - the ssh client on your machine will listen on this port, you can chose for example 55555. In the web browser you will then set the HTTP proxy as localhost on port 55555.
  • $portproxy - the port the Squid proxy is listening on.
  • $machineproxy - address of the Squid proxy machine (as seen from the gateway).
  • $machinegateway - address of the gateway machine as seen from your PC

The SSH server on the gateway must allow port forwarding. If it is not allowed you will have to ask administrator of the server to do so.