TL;DR — Quick Summary
Sshuttle creates a VPN-like tunnel over SSH without server configuration. Route all traffic or specific subnets through any SSH server. No root needed on remote.
Sshuttle turns any SSH server into a VPN endpoint. No server configuration, no VPN software to install, no certificates to manage. If you can SSH to a machine, you can tunnel your traffic through it.
Installation
# Debian/Ubuntu
sudo apt install sshuttle
# macOS
brew install sshuttle
# Arch
sudo pacman -S sshuttle
# pip (any platform)
pip install sshuttle
# Fedora
sudo dnf install sshuttle
Basic Usage
# Route specific subnet through SSH server
sshuttle -r user@server 10.0.0.0/8
# Route ALL traffic (full VPN)
sshuttle -r user@server 0/0
# Route all traffic + DNS
sshuttle -r user@server 0/0 --dns
# Route multiple subnets
sshuttle -r user@server 10.0.0.0/8 192.168.1.0/24
# Exclude subnets (avoid routing SSH connection itself)
sshuttle -r user@server 0/0 -x server.ip.address/32
Common Use Cases
Access Office Network Remotely
# Route office subnet through jump box
sshuttle -r admin@jumpbox.company.com 10.10.0.0/16
# Now you can access 10.10.x.x servers as if you were in the office
Secure Public WiFi
# Route everything through your home server
sshuttle -r user@home-server.duckdns.org 0/0 --dns
# All traffic now exits from your home connection
Access Cloud VPC Resources
# Route AWS VPC subnet through bastion host
sshuttle -r ec2-user@bastion.example.com 172.16.0.0/12
# Access RDS, ElasticSearch, etc. that are in private subnets
Bypass Geo-Restrictions
# Route through a server in the target country
sshuttle -r user@us-server.example.com 0/0 --dns
Advanced Options
# Use specific SSH key
sshuttle -r user@server 0/0 -e 'ssh -i ~/.ssh/custom_key'
# Use non-standard SSH port
sshuttle -r user@server:2222 0/0
# Verbose output for debugging
sshuttle -vvr user@server 0/0
# Daemon mode (background)
sshuttle -D -r user@server 0/0 --pidfile /tmp/sshuttle.pid
# Auto-sudo (don't prompt for password)
sshuttle --auto-sudo -r user@server 0/0
Comparison
| Feature | sshuttle | SSH -D (SOCKS) | OpenVPN | WireGuard |
|---|---|---|---|---|
| Server setup | None | None | Complex | Moderate |
| Server root needed | No | No | Yes | Yes |
| Local root needed | Yes | No | Yes | Yes |
| Transparent routing | Yes | No (SOCKS) | Yes | Yes |
| UDP support | No | No | Yes | Yes |
| DNS tunneling | Yes (—dns) | No | Yes | Yes |
| Performance | Good | Good | Better | Best |
| Use case | Quick access | Single app | Production | Production |
Limitations
- TCP only: sshuttle routes TCP traffic. UDP (including DNS by default) is not tunneled unless you use
--dns - Local root: Needs root/sudo on the local machine to set up routing rules
- Python on server: The remote server must have Python installed (most Linux servers do)
- Performance: SSH adds overhead compared to native VPN protocols like WireGuard
Summary
- Sshuttle creates transparent VPN-like tunnels over any SSH connection
- No server configuration or root access needed on the remote — just SSH + Python
- Route specific subnets or all traffic (0/0) with optional DNS tunneling
- Perfect for quickly accessing office networks, securing public WiFi, or reaching cloud VPC resources
- TCP only — use WireGuard or OpenVPN for production VPN needs with UDP support