strboul blog

Tunnel your traffic over SSH proxy


If you're unable to use a VPN for various reasons, setting up your own SOCKS5 proxy can be a viable alternative to tunnel your traffic over SSH. The tunnel connection is encrypted. While it may not be a complete replacement of a VPN, as the tunnel needs to be set for each application individually, it can still offer a good level of privacy and security.

Run the following command in your terminal to create the SSH tunnel:

ssh -D 9999 -p 22 -C -N [email protected]

Once the tunnel is set, use your preferred browser to use the SOCKS tunnel proxy server. For example, if you're using Chromium, you can run the following command to start it with the SOCKS proxy server:

chromium --proxy-server="socks://127.0.0.1:9999" --incognito

If you prefer to use curl, you can use the -x parameter to specify the SOCKS5 proxy:

curl -x socks5h://127.0.0.1:9999 ifconfig.me