trevcan@internets /dev/human $

Lazy man's VPN or Simple VPN through SSH

Posted on: 03/16/22 16:00:48
Last edited: 05/25/22 21:44:35

It works like a VPN, acts like a VPN, feels like a VPN; but it kinda isn’t a VPN.

Would you like to access your local network ?

Are you too lazy to set up a real VPN server like me ? Do you like security ? Well, now you can use a virtual private network through ssh and route all requests from one machine to another, using sshuttle.

tldr

commands:

sshuttle -x server.org -r user@server.org 0.0.0.0/0 --dns
sshuttle -x server.org -r user@server.org addresses/subnet --dns

WHERE:

server.org is your (ssh-enabled) server’s domain name.

-x server.org means, exclude the server.org domain from being routed through your server (server.org), the wiki says some problems occur on some linux machines - it will recursively resolve to itself and the ssh session will crash.

use 0.0.0.0 on SUBNET to route ALL requests through ssh server.

use 24 for subnet and use 192.168.1.0 on addresses to route requests starting with 192.168.1. through the ssh server.

e.g. sshuttle --dns -x server.org -r user@server.org 192.168.1.0/24

references

Tags: vpn ssh security short linux