selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

GitHub
sshuttle logo

Self-host sshuttle

v2.0.0

Poor-man's VPN that tunnels all your traffic via SSH

ReleaseOpen SourceLGPL-2.1
Updatedlast month
LanguagePython
Setup difficultyEasy
Stars
13 654
Requires
OpenSSH
Install with Linux

What is sshuttle?

sshuttle is a command-line tool that builds a VPN-like tunnel from your machine to any host you can reach over SSH, forwarding entire subnets instead of one port forward per service. It captures traffic using the operating system's own firewall facilities - iptables NAT rules or nftables on Linux, pf on macOS, FreeBSD, OpenBSD and pfSense, ipfw, and the TPROXY method when UDP is needed - and multiplexes established connections over a single SSH session, so it avoids the TCP-over-TCP penalty of openssh tunnelling. Convenience options relay DNS queries to the remote resolver, add the extra networks the remote host suggests, and merge discovered remote hostnames into a local hosts file. The far side needs no installation beyond a recent Python: sshuttle uploads its own source and runs it there, and no administrator privileges are required on the remote network, though you do need sudo or root locally. Install it with your package manager or pip and run it in the foreground, as a background daemon, or as a systemd notify service; running it on a router lets a whole LAN share the tunnel. Requires Python 3.10 or greater on both client and server, and Windows support is experimental and limited to IPv4 TCP.

sshuttle alternatives

Should you self-host sshuttle?

sshuttle scores 69/100 on selfhost.directory (how scoring works) and ranks #10 of 56 in VPN. It has 13 654 GitHub stars, +56 in the last 30 days.

It shipped 1 stable release in the past year. The latest, v2.0.0, came out on 28 September 2026.

Setup is easy: most people get it running in one sitting. It is LGPL-2.1-licensed and written mostly in Python.

Its closest alternative on selfhost.directory is Tailscale (84/100, 38 833 stars). It scores higher overall, so compare the two before you pick. See sshuttle vs Tailscale side by side.

Features

  • Automatic remote hostname discovery
  • Automatic subnet detection
  • Daemon mode with syslog and pidfile
  • DNS Tunneling
  • IPv6 Supportnat, nft, tproxy and pf methods; can be disabled
  • Latency control tuning
  • Multiple simultaneous tunnels
  • No admin rights needed on remote server
  • Passwordless sudo via generated sudoers fileLinux and MacOS; project warns the generated file is insecure
  • Router mode for a whole LAN
  • Selectable firewall methods
  • Subnet and port-range selection with exclusions
  • Systemd service support
  • UDP forwardingTPROXY method only
  • VPN-over-SSH tunneling

sshuttle README

sshuttle: where transparent proxy meets VPN meets ssh

As far as I know, sshuttle is the only program that solves the following common case:

  • Your client machine (or router) is Linux, FreeBSD, MacOS, or Windows (experimental).
  • You have access to a remote network via ssh.
  • You don't necessarily have admin access on the remote network.
  • The remote network has no VPN, or only stupid/complex VPN protocols (IPsec, PPTP, etc). Or maybe you are the admin and you just got frustrated with the awful state of VPN tools.
  • You don't want to create an ssh port forward for every single host/port on the remote network.
  • You hate openssh's port forwarding because it's randomly slow and/or stupid.
  • You can't use openssh's PermitTunnel feature because it's disabled by default on openssh servers; plus it does TCP-over-TCP, which has terrible performance.

How to install sshuttle

Install sshuttle with Linux

dnf install sshuttle

How to configure sshuttle

  • --methodautoWhich firewall method to use; auto guesses from what is in PATH.

    values: auto, nat, nft, tproxy, pf, ipfw

  • --dnsCapture local DNS requests and forward them to the remote DNS server.
  • --ns-hostsCapture DNS requests only to the listed server(s) and forward them remotely.
  • --to-nsDNS server to forward requests to when remote resolution is enabled.
  • --pythonpython3Name or path of the remote python interpreter.

sshuttle releases & version history

@ Every self-hosted release, weekly

One Monday email with the week's stable releases across the directory.

More in VPN

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…