Protecting Your Data with SSH – Setting up a Proxy (Part 2)

In the first part of this article I introduced Public Key Encryption and SSH. In this part, we will look at how to use SSH to secure your traffic when using an untrusted network.
As previously mentioned, this was partly inspired by events from SuperHappyDevHouse. At the last event we wanted to promote the idea of encrypting your traffic. One of the ideas was to simply write out the command for encrypting your SSH traffic on whiteboards that were placed around the house for collaboration. This was a step in the right direction as people came up to the group of people I was with and asked for help. At least we brought awareness to this problem.
The code we posted was simple:
sudo ssh -l <username> -NfD <port> <ip>
This creates an SSH tunnel that acts as a SOCKS5 proxy server using the specified port. All traffic going through this proxy will be tunneled through SSH and thus be encrypted. Before we get ahead of ourselves, let’s take a look at the options we specified.

  • -l – Specifies the username on the remote server
  • -N – Tells SSH not to run any remote commands.
  • -f – Has SSH run in the background.
  • -D – This is the option that actually creates the SOCKS server.

Thank you Mike Lundy for preparing the command for everyone!
Now that we have SSH running in the background as a SOCKS proxy server, we need to configure our applications to use it. For our example we will look at configuring Firefox to send all of its traffic over SSH.
Under Tools->Options, navigate to “Advacned” and click on the “Network” tab. When you click on the “Settings” button, it will bring up options for “Connection Settings.” Here you can manually configure your proxy settings by clicking the “Manual proxy configuration” radio button and then under “SOCKS Host:” type “localhost” and the port specified in the ssh command you issued earlier under “Port.” Click “OK” and you now have all of your Firefox traffic being tunneled through SSH.

RSS – Introduction (Part 1)

Adam Darowski recently asked to pick my brain about writing a PHP script to create an RSS feed from a database. As one of my favorite “Web 2.0” technologies, I figured I would write a 3-part introductory series on RSS and PHP.

In this series I want to cover a couple topics:

  • What is RSS?

  • Digging deeper into RSS
  • Creating an RSS feed with PHP

Before we begin, let me pose a question: Are there sites you check frequently? Perhaps you check a friend’s blog on a daily basis or refresh a news site to get all of the latest headlines. This in itself can be time consuming, especially if you check multiple sites on a daily basis. RSS’s most popular application solves this problem; it will notify you when a site has been updated. Instead of checking your friend’s blog, you can subscribe and be notified of updates.

In order to use RSS for this purpose, we will need two things:

  • RSS Reader

  • RSS Feed

I prefer to use a web-based RSS reader such as Google Reader. (See this post to find out why)

Add RSS Feed

To add an RSS feed to Google Reader, click on “Add Subscription” and type in the URL of the site (nickpeters.net for example).

When we click “Add” we will now be subscribed and notified when nickpeters.net has been updated; It’s that simple.

Firefox2.0 has built in support for adding an RSS feed to the reader of your choice. See that RSS Icon in the corner of the address bar? What happens if we click on it? We’ll be redirected to another page that allows you to subscribe to the site using an RSS Reader of our choice.

Now that you have two ways to subscribe to a site, try this out for blogs or news sites you visit on a regular basis.

Next, we will take a look inside a basic RSS feed.