Lojic Technologies

Surf Securely Using SSH

with one comment

This is so easy, you’re gonna love it! Thanks Tyler Pedersen.

Motivation

I’ve been using my laptop more frequently at wifi hotspots. Many web sites I visit encrypt traffic with SSL for authentication, but after that they send traffic in the clear which means the cookies that are used for authentication purposes are sent in the clear, so anyone with a sniffer within range of my laptop could easily intercept the traffic, steal my cookies and impersonate me on the web site. Not good! So, I went looking for a simple solution, and found a great article about using ssh for this purpose. Ya gotta love open source software 🙂

Prerequisites

I’ll assume the following:

  1. You’ve used ssh before
  2. You have access to a remote host running sshd

How To

Issue the following command on your local computer:

ssh -Nf username@hostname.com -D 1080

replace username@hostname.com with the appropriate information. Look at the man page for ssh, or read the article linked above for an explanation of the options.

The next step is to configure Firefox to use the SOCKS proxy you setup with the above command. I’m using Firefox 2.0.0.6 on Ubuntu 7.04 Linux.

Edit | Preferences | Advanced | Settings

Pulls up the following dialog:

socks.png

Notice how I’ve switched from “Direct connection to the Internet” to “Manual proxy configuration”. I’ve also set the SOCKS Host to be ‘localhost’ and the port to be ‘1080’.

I can now surf and have encrypted traffic between my local computer and the remote host I ssh’d to. The traffic between my remote host and the destination web site will be unencrypted, but hopefully that traffic is harder to sniff without being detected.

At this point, I tested it out and everything worked fine. I then killed my local ssh process and Firefox complained about the connection being reset, so I knew it was in fact sending data over the ssh tunnel.

The final step is optional, but if you want to avoid having the bad guys detect your DNS requests (or possibly redirect them – d’oh!), you can configure Firefox to route DNS requests through the proxy.

  1. Type about:config in the Firefox address bar.
  2. Look for network.proxy.socks_remote_dns and set the value to true

Is that easy or what? Thanks again Tyler.

Written by Brian Adkins

August 2, 2007 at 12:28 am

Posted in internet

Tagged with , , ,

One Response

Subscribe to comments with RSS.

  1. Nifty, thanks! Works fine on Windows with Cygwin’s ssh. Some application was using port 1080, but I chose another port without any difficulty (8001).

    As expected, Covenant Eyes works in this configuration without any problems. Of course, if you are using Covenant Eyes and want your URL reports to be encrypted you can also configure proxy settings for Covenant Eyes.

    Scott Moonen

    August 2, 2007 at 2:35 pm


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: