sshuttle -vNHr usernmae@server [Remote Network]
sshuttle -vNHr vpnuser@vpn.testdomain.com:1234 192.168.1.0/24
For sshuttle to work, you don’t need any special setup on the server side beyond a standard SSH server configuration. However, there are a few things to ensure:
1. SSH Access
- The SSH server must be running and accessible from your client machine.
- You need valid SSH credentials (username and password, or preferably, an SSH key) to log in to the server.
2. Root Privileges (Optional)
sshuttleworks best if the SSH user has root privileges on the server. This allowssshuttleto set up the necessary routing and firewall rules automatically.- If the SSH user does not have root privileges,
sshuttlecan still work, but it will use a slower method (using--pythonmode) that doesn’t require root access on the server.
3. Python on the Server
sshuttlerequires Python to be installed on the server. Most Linux distributions come with Python pre-installed, but if it’s missing, you’ll need to install it.
4. Firewall Rules
- Ensure that the server’s firewall (e.g.,
iptables,ufw) allows SSH traffic (port 22 by default) and doesn’t block the traffic thatsshuttlewill route through the SSH connection.
5. DNS (Optional)
- If you want
sshuttleto handle DNS requests as well (so that DNS queries are also routed through the VPN), you can use the--dnsoption. This requires that the server can resolve DNS queries.