hi everyone is there any way to open 3128 port (which is closed by firewall) using ssh? i have root access to the server thnx
migrated from stackoverflow.com Jan 16 '11 at 4:16
This question came from our site for professional and enthusiast programmers.
It is likely that the 3128 port on the server is closed to the external network interface but not to localhost, so you can access it by using port redirection over ssh.
If you want to use the squid proxy on that server running at port 3128 from your local machine, you can ssh into the server and expose the port on your local machine with the following:
ssh user@servername -NfL 3333:localhost:3128
-N means do not execute a remote command, just make the connection and do the port redirect
-f means make ssh go into the background, so you can close or continue to use the command prompt
-L means take Local port 3333 and connect it to the remote machine's localhost:3128
If you do a ps -ax afterwards, you will see the connection is running in the background, and you can kill it with its pid if you need to.
Then you can point your browser's proxy setting to http://localhost:3333 and it should work fine.
You can also use the following to have command-line tools use the proxy too, like lynx, yum, apt-get, etc: