PDA

View Full Version : [ubuntu] How do I access the internet using a secure connection to my Ubuntu server?



boondocks
June 11th, 2011, 12:18 PM
I have a Ubuntu laptop when I travel.
And a Ubuntu server back at my desk.
The laptop connects to the server via OpenVPN.
So I can access all the resources on the server from the laptop.

What applications/packages should I install on these Ubuntu systems such that:

When I am travelling and using public/hotel WiFi that I am accessing the internet securely from the Ubuntu laptop via the Ubuntu server. Instead, of accessing the internet directly from the laptop.
On the laptop, I generally use a web browser, chat client, etc. Like Firefox, Chrome, Pidgin, ...
So I have some degree of safety/privacy when I am on the road.

Joe of loath
June 11th, 2011, 01:57 PM
I use ssh. If you run ssh -D 8080 (server-ip/hostname), and set all your applications to use a proxy of localhost:8080, everything will go through the encrypted shh connection.

boondocks
June 11th, 2011, 08:02 PM
Does that take care of TCP and UDP ?

Joe of loath
June 11th, 2011, 08:14 PM
It will tunnel everything, provided it's given the proxy server.

boondocks
June 11th, 2011, 09:24 PM
Ok.
What do I need to install/run on the server side?

Joe of loath
June 11th, 2011, 09:25 PM
All you need to do on the server side is have ssh running, and listening on a few different ports (in case some are blocked). I run it on 22, 80, 443 and 8080.

boondocks
June 11th, 2011, 09:34 PM
So if I am not running something like squid on the server ...
then will the sshd on the server be just a conduit between the remote laptop and (say) google.com ?

Where conduit = transparent + encrypted

Joe of loath
June 11th, 2011, 09:49 PM
Yup, all your traffic is wrapped up and encrypted on your laptop, flies through the internet looking like gibberish, and pops out of the server as it would have come from your laptop.

boondocks
June 11th, 2011, 09:53 PM
Currently, I am running apache2 on this server on port 80 and 443.
Can your suggestion work concurrently with this apache2 setup?

Joe of loath
June 11th, 2011, 11:05 PM
Yes, just don't set ssh to listen on those ports. Unfortunately, if you're somewhere where port 22 and 8080 are blocked, you might not have much luck.

boondocks
June 11th, 2011, 11:13 PM
Do you mean ...
if I am using a Wifi at a coffee shop where they block outbound ports 22 and 8080
... then I am out of luck?

Thewhistlingwind
June 11th, 2011, 11:14 PM
Do you mean ...
if I am using a Wifi at a coffee shop where they block outbound ports 22 and 8080
... then I am out of luck?

Not necessarily, from what I understand, you can change the port of your SSH.

Joe of loath
June 11th, 2011, 11:19 PM
Not necessarily, from what I understand, you can change the port of your SSH.

Usually places like that block everything except ports 80 and 443, hence why I suggested listening on those ports.

boondocks
June 11th, 2011, 11:23 PM
Ok, understood.

Anway, I have not had that problem so far because ...

I have a Ubuntu laptop when I travel.
And a Ubuntu server back at my desk.
The laptop connects to the server via OpenVPN.
So I can access all the resources on the server from the laptop.

... therefore I can access all the ports on my server because they are accessible/visible thru the OpenVPN tunnel.
So I assume the only port visible between my laptop and my server would be my unique UDP port being used by the OpenVPN connection.