Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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 ;)

share|improve this question

marked as duplicate by Eliah Kagan, John S Gruber, con-f-use, SirCharlo, izx Aug 21 '12 at 20:31

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

2 Answers 2

up vote 2 down vote accepted

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).

share|improve this answer
    
How would I set up a VPN server on my Ubuntu Server? –  mazzzzz May 5 '12 at 2: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 5 '12 at 3:16
    
My misunderstanding, I thought those were for the client, not server; I'll give them a shot, thanks. –  mazzzzz May 5 '12 at 3:46

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!

share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.