Socks Proxy Using SSH Tunnel On Linux

stillbigjosh
3 min readFeb 6, 2020

--

Prerequisites

  1. A dedicated server with SSH Access
  2. Web browser(firefox)
  3. Linux local computer

Setting up a socks 5 proxy has never been easier if these requirements are met, if you are reading this I wrote with an assumption that you already knows what a socks proxy is, if not, you can read this .

In this how to manual, we will be using a linode dedicated server, you can spin up a linux nanode at a relatively cheap price, at a chosen data center.

How to?

  1. Spin up a lightweight server, through which the web traffic will be routed

2. Open a terminal on your local computer, tunnel using the command below

  • -D specifies the port through which the web traffic will be routed, this can be any number between 1025–65536
  • -f forks the ssh process to the background
  • -C gzip compresses all data
  • -q quiet mode
  • -N indicate no command will be sent once the SSH tunnel is up

Replace the ubuntu-us-xxxx with the IP address of your nanode server

3. Configure your web browser to connect to the SSH tunnel

Goto preferences > network settings

4. And that’s it! you can whatsmyipaddress to check your IP changes

As you can see, the IP address has successfully changed to that of the nanode server.

5. To kill the ssh tunnel and disable the socks proxy

And further change your web browser network settings to use system proxy settings

--

--