Use a remote server as SOCKS proxy for browser and command line commands

With SSH create a SOCKS proxy it’s really easy, just log into your account on the remote server, and leave it open

ssh -D [PORT:9000] user@host.com

Then change the proxy configuration for your browser, or even better, your operative system, to use SOCKS and the port that you previously used, make sure to put on the host field localhost, it’s not your remote host, that’s the whole idea of it, it will pass the traffic to your localhost and then it will use the ssh process running to transfer it to your remote server.

At that point you will be able to browse as if you were on the remote server, but, when you run a command from the terminal it will “ignore” this proxy, at least on ubuntu, don’t know why, in order to “fix” this you need to export this configurations

export http_proxy=http://localhost:[PORT:9000]/
export https_proxy=http://localhost:[PORT:9000]/

Notice that the port has to be the same as the one when you run the SSH command.

And that’s all.

One thought on “Use a remote server as SOCKS proxy for browser and command line commands

  1. I have noticed you don’t monetize your page, don’t waste
    your traffic, you can earn additional bucks
    every month because you’ve got high quality content.
    If you want to know how to make extra money, search for: best adsense alternative Wrastain’s tools

    Like

Leave a comment