Linux Hack of the Week #17: Using SSH as a Proxy

When I travel and have to use public WiFi networks I make sure to encrypt all of my traffic. There are a number of paid VPN services that can be utilized, but there is also a way to accomplish the same security for free by accessing an SSH server.

OpenSSH has built-in support to work as a SOCKS proxy server. As most people know, most Unix and Linux systems include the ssh command. One addition to the ssh command will have you sending your data through an encrypted tunnel.

Set Up the Proxy

Setting up the proxy is simple: ssh to your client with the additional options -D PORT -C. The flag -D is used to start the SOCKS proxy, and port is any above 1024. The option -C tells it to compress the data.

ssh -D 1984 -C

Client Configuration

Depending on which OS and browser you are using, configuration settings will most likely be found under network, or in the browser under network settings. The most important detail is entering the localhost and the same port used above.


In your browser search for “what is my IP”. This should show the IP of the host you have ‘SSH’d’ to. Now all of your traffic is encrypted and running through the SSH tunnel.


I hope this post helps those looking to safely bypass a firewall or encrypt data while using a less than trustworthy network. As always, feel free to let me know if you have any questions:

About Automox

Facing growing threats and a rapidly expanding attack surface, understaffed and alert-fatigued organizations need more efficient ways to eliminate their exposure to vulnerabilities. Automox is a modern cyber hygiene platform that closes the aperture of attack by more than 80% with just half the effort of traditional solutions.

Cloud-native and globally available, Automox enforces OS & third-party patch management, security configurations, and custom scripting across Windows, Mac, and Linux from a single intuitive console. IT and SecOps can quickly gain control and share visibility of on-prem, remote and virtual endpoints without the need to deploy costly infrastructure.

Experience modern, cloud-native patch management today with a 15-day free trial of Automox and start recapturing more than half the time you're currently spending on managing your attack surface. Automox dramatically reduces corporate risk while raising operational efficiency to deliver best-in-class security outcomes, faster and with fewer resources.