Archive

Posts Tagged ‘application’

Securing Your Internet Connection With SSH

March 22nd, 2009 jdhalbert No comments

When using public or other unsecured wifi, it becomes much easier for hackers and sniffers to root out your private information, compromising your privacy, and maybe even your identity.

And just for your information (not that I would ever condone this ;) , this technique can also bypass internet blocks enforced by companies, schools, etc.

firefox_secure_logo.png

I’ll provide the Mac instructions, but the same is possible on a PC using an SSH client, such as OpenSSH.

Manual Instructions

  1. Get (or use your existing) web hosting that supports SSH. Unlimited bandwidth is preferred. My recommendation: Bluehost.
  2. Set up your SSH, remembering your passwords and usernames.
  3. Open Terminal
  4. Type in the following code: ssh -ND 9999 yourusername@yourwebsiteaddress.com (You will be prompted for your password. Enter it. The terminal window will appear to freeze up; this is what you want, and means that you have successfully connected. This opens port 9999, connects through SSH to your server, and stays open until you terminate it; it’s basically a secure tunnel that you’re going to route your internet traffic through.)
  5. Open Firefox, then Preferences, then the Advanced tab, and click Settings (how Firefox connects to the internet).
  6. Choose Manual Proxy Configuration.
  7. Under SOCKS Host, type localhost and under Port, 9999. Under No Proxy for, type localhost, 127.0.0.1. Select SOCKS v5.
  8. Click OK.

If you’ve done everything correctly, Firefox will appear to work as usual, but perhaps slightly slower.

Congrats! You are using secure internet!

When you are done using your secure connection, change Firefox preferences back to No Proxy, and terminate your Terminal. DO NOT just close Terminal–you are likely to remain connected. Select Terminal and press Apple-Period (Cmd-.), then quit.

Using AppleScript (Creating a Secure Internet Application) – Apple only

I’ve made the instructions pretty straight-forward, but you might need to be a little tech-savvy to figure this one out. This will combine all the steps above into an application that will give you secure internet access.

  1. Download and install NPS AskPass (for Tiger–it works with 10.4 and above, including Leopard)
  2. Open Terminal and type /Applications/Firefox.app/Contents/MacOS/firefox -ProfileManager
  3. Create a Firefox profile called “secureaccess”
  4. Open your new Firefox profile, and follow steps 5-8 above. Close Firefox when you’re done.
  5. Open Script Editor and create a blank script.
  6. Save it as “proxysetup.app” (application bundle) to your desktop.
  7. Open Finder, go to Firefox, right click and hit “Explore Package Contents.” Open the Contents folder, then create a folder called “securessh.”
  8. Drag your proxysetup.app from your desktop into your newly created folder within Firefox.
  9. Back in Script Editor, enter the following into your proxysetup file:
    do shell script “ssh -ND 9999 yourusename@yourwebsiteaddress.com &> /dev/null &”
  10. Save proxysetup.app and close it.
  11. DOWNLOAD MY PRE-COMPILED APPLICATION HERE. You must have followed all previous instructions EXACTLY or it will not function. Open the application with Script Editor if you need to make any changes to tailor it to suit you.

When you run the application, it should do three things, in no particular order:

  1. Open a dialog box indicating to click OK to close the connection. Put this off to the side, and only click OK when you are done. (After you click this, a dialog will appear saying something like “Can’t get end.” Don’t worry, that just means that your connection is closed. That is what you want.
  2. Open your “secureaccess” Firefox profile with the proxy settings all ready to go!
  3. Open a password dialog box. Enter your server’s password to connect to the proxy. Firefox will then be able to connect to the internet in a secure fashion!

Congratulations! You now have a secure internet application!

BONUS: If you want it to have my custom and cool-looking golden Firefox symbol (as seen above) just save the image file, make an icon out of it with Pic2Icon, and then place it over the existing icon (hit Cmd-I on both files, and drag the icon over).

Enjoy!