6

Possible Duplicate:
How do I route my internet through a SSH tunnel?

I just got a new laptop and put Ubuntu on it as a good way to force myself to learn Linux. This laptop will be going with me to school, work, the local coffee shop, etc. So I wanted a secure way to browse without pesky filters and worrying about the open wifi.

I setup a simple autossh script to run in cron on startup, but I want to route all my traffic, not just web traffic pointed to the local loop back. That way I don't need to worry about my chats etc. I've seen some other posts like this, but they had different requirements to meet, none of which I am limited by; so I'm curious if there is a better option then SSH (which seems to have quiet a bit of overhead).

So the question, what is the best option for tunneling all traffic (securely of course) from an Ubuntu desktop to an Ubuntu server? One preferably with an example ;)

Jess
  • 245

2 Answers2

12

You can use sshuttle.

While doing it over SSH isn't the greatest idea, it works, and I've lost count of how many times I've used it when I can't get into my VPN.

This is how to get it set up:

First, make sure git is installed by running:

sudo apt-get install git

Then, clone the code from github:

git clone git://github.com/apenwarr/sshuttle

You'll need root or sudo access, and python needs to be installed.

Then, do this:

cd sshuttle

./sshuttle -r username@sshserver 0.0.0.0/0 -vv

Also, to make it easier to access everything via ssh, you'll want to set up DynDNS or something similar.

Best of luck, and safe browsing!

jrg
  • 60,611
  • sshuttle won't work on many protocols; it's not a proper solution since it combines TCP and UDP simultaneously with a default 32000 buffer size :(. – Ali Akhtari Dec 12 '22 at 10:50
3

ssh tunnels are the wrong tool for this; you want a VPN (or possibly TOR, but probably not if you only care about a single fixed endpoint server).

geekosaur
  • 11,597
  • How would I set up a VPN server on my Ubuntu Server? – Jess May 05 '12 at 02:39
  • Did you follow the link on "VPN"? The Ubuntu Wiki gives example installation recipes for a number of configurations and versions; for your setup you probably want OpenVPN (VPNC), not PPTP or Cisco. – geekosaur May 05 '12 at 03:16
  • My misunderstanding, I thought those were for the client, not server; I'll give them a shot, thanks. – Jess May 05 '12 at 03:46