Guides Quick and Dirty VPN With sshuttle

Quick and Dirty VPN With sshuttle

In the age of Firesheep and other network nastiness, you must be careful how you connect to remote networks. Setting up or connecting to VPNs can be a major hassle — but with sshuttle, you can set up a quick and dirty VPN on any network to which you have SSH access.

This Python app makes use of SSH to create a VPN between a Linux, BSD, or Mac OS X machine and a remote system that has SSH access and Python — great for building a VPN on the fly.

What’s sshuttle? It’s a Python app that makes use of SSH to create a on-the-fly VPN between your Linux, BSD, or Mac OS X machine and a remote system that has SSH access and Python. Written by Avery Pennarun and licensed under the GPLv2, sshuttle is a transparent proxy server that lets users fake a VPN with minimal hassle.

The code is hosted on Github right now. It’s a fairly new program that hasn’t yet made its way yet into any of the major distros that I’m aware of. You’ll need git to grab the source (git clone git:// and install it on the client machine. You do need root access on the client — nothing needs to be installed on the server.

To run sshuttle, you’ll need to be root or use sudo and then cd to the sshuttle directory you grabbed from Github. Use sshuttle -r [email protected] You’ll want to replace the [email protected] stuff with your specifics, of course, and you’ll want to replace the IP address with the specific IP addresses you want to use.

Side note — if you don’t replace the IP with the addresses for the network you’re VPN’ing into what you get is a proxy for all traffic out through the remote server instead. This can be useful if you’re looking for a quick and dirty proxy for traffic because you don’t trust the local network. I’ve tried this mode using my server while sitting in the airport, and it seems to work transparently and fine.

A little caution should be employed when using sshuttle, however. First, since it doesn’t require root or administrator access on the remote machine, you want to make sure you’re not violating any company policies by using sshuttle. In other words, just because you have the technical ability to do something doesn’t necessarily mean you should or won’t get fired for doing so.

Second, it’s a relatively new application, and it hasn’t been widely tested in the wild. Use with caution, and be sure to report any problems to Pennarun. Since it’s on Github, it should be easy to suggest patches as well.

That said, sshuttle looks like an interesting little utility, and I think it might be useful for a lot of admins. Give it a shot and see what you think!

Joe ‘Zonker’
is a freelance writer and editor with more than 10 years covering IT. Formerly the openSUSE Community Manager for Novell, Brockmeier has written for Linux Magazine, Sys Admin, Linux Pro Magazine, IBM developerWorks,,, Linux Weekly News, ZDNet, and many other publications. You can reach Zonker at [email protected] and follow him on Twitter.

Follow ServerWatch on Twitter

Latest Posts

How to Convert a Physical Computer to a Virtual Machine

Many organizations are implementing virtualization technology into their networks to convert physical computers to virtual machines (VM). This helps reduce overall physical hardware costs,...

HPE ProLiant DL380 Gen10: Rack Server Overview and Insight

The HPE ProLiant DL380 series has consistently been a market leader in the server space. The Gen10 released in 2017 further increased HPE's market...

Best Server Management Software & Tools 2021

Finding the best server management software tools for your organization can have a major impact on the success of your business operations. Manually handling...

IBM AS/400: Lasting the Test of Time

Some server operating systems (OS) were built to survive the test of time – the IBM AS/400 is one such system.  The AS/400 (Application System/400)...

What is Disaster Recovery?

The modern organization's heavy dependence on using data to drive their business has made having a Disaster Recovery (DR) plan in place a necessity....

Related Stories