Route all traffic through SSH tunnel or equivalent?

21,216

Solution 1

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

Solution 2

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:
21,216

Related videos on Youtube

Asif Asif
Author by

Asif Asif

Updated on September 18, 2022

Comments

  • Asif Asif
    Asif Asif over 1 year

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

  • geekosaur
    geekosaur about 12 years
    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.
  • Asif Asif
    Asif Asif about 12 years
    My misunderstanding, I thought those were for the client, not server; I'll give them a shot, thanks.