Skip to content

sshuttle

7 commands

A transparent proxy that tunnels a whole subnet over a plain SSH connection, with DNS support and no special software on the remote host.

  • pivoting
  • VPN
  • SSH
  • tunneling

Install sshuttle

sudo apt install sshuttle

Basics4

sshuttle -r <user>@<host> <subnet>

Transparently routes a subnet through SSH — like a poor man’s VPN, no config on the remote side.

Link
sshuttle -r <user>@<host> 0/0

Routes all traffic through the host.

Link
sshuttle -r <user>@<host> --dns <subnet>

Also sends DNS queries through the tunnel so internal names resolve.

Link
sshuttle -r <user>@<host> <subnet> -x <exclude>

Excludes an address, such as the gateway, from the tunnel.

Link

Options3

sshuttle -r <user>@<host> <subnet> --ssh-cmd "ssh -i <key>"

Passes extra SSH options such as a key file.

Link
sshuttle -r <user>@<host> <subnet> -v

Verbose output for debugging the tunnel.

Link
sshuttle -r <user>@<host> <subnet> -D

Runs as a daemon in the background.

Link