Bo's Log 一寸欢喜

How to setup socks proxy with ssh tunnel

2020-12-30
Bo Chen

A SOCKS proxy is an SSH encrypted tunnel in which configured applications forward their traffic down, and then, on the server-end, the proxy forwards the traffic to the general Internet. Unlike a VPN, a SOCKS proxy has to be configured on an app-by-app basis on the client machine, but you can set up apps without any specialty client software as long as the app is capable of using a SOCKS proxy. On the server-side, all you need to configure is SSH.

Setup ssh tunnel with cli on your local machine

ssh -i ~/.ssh/id_rsa -D 1337 -f -C -q -N user@your_domain

  • Explanation of arguments
    • -i: The path to the SSH key to be used to connect to the host
    • -D: Tells SSH that we want a SOCKS tunnel on the specified port number (you can choose a number between 1025 and 65536)
    • -f: Forks the process to the background
    • -C: Compresses the data before sending it
    • -q: Uses quiet mode
    • -N: Tells SSH that no command will be sent once the tunnel is up

Setup tunnel with putty on windows


Similar Posts

Content