Home Download Ubuntu

How to make a secure tunnel conection to a linuxbox from a linux client through ssh

Let's say that you are on a coffe in down-town where you have wi-fi and your laptop with you, and you want to browse secure. You should know that a wireless connection is always unsecure, because anybody can sniff your packets and find out what you're doing on your laptop.

The linuxbox that we are going to use, has a ssh server up and running and connected to internet. So the tunneling that we are going to make can route any applications that supports SOCKS5 proxy.

So let's connect to our ssh server by using terminal:

sudo ssh root@123.123.123.123 -D 8080


- root should be your remote linuxbox user
- 123.123.123.123 should be your remote linuxbox ip. you can put a domain name if it has one.
- -D 8080 makes a secure tunneling to your linuxbox ssh server by local port 8080

Now we can setup any applications that supports SOCKS5 proxy to use this secure ssh tunneling.

Example:

Setting up Firefox browser to use our SOCKS5 proxy connection.

We open up firefox and go to preferences: edit->preferences or tools->options, which is different by your version of Firefox. We go to Advanced tab and then Network and we click Settings.

We click manual proxy configuration like in this image, then on socks input we enter localhost and on the port input we enter 8080 that we used to setup our SOCKS5 proxy tunneling. Then we click OK.



We can check now that we are using ssh tunneling by running a website that shows our ip adress, like http://www.ip-adress.com and we should see the linuxbox ip adress.

The video that inspired me to make this tutorial:



Resources: ssh man page, 101 uses of openssh, hak5

0 comments:

Post a Comment