Categories
Web 0.1

Web 0.1: Ordnance Survey / UK govt

I think it is a fantastic and wonderful thing that the complete, detailed, maps of the UK are now free for all commercial and non-commercial use. This is a long way ahead of any other country – these maps are many times more detailed and accurate than e.g. the Google Maps / Yahoo Maps / Streetmap datasets.

(PS: these days, the excellent OpenStreetMap (which works in every country – and I wanted to name-check here for anyone who isn’t aware of it already) has advanced so much that it’s seriously encroaching on the OS … why did we have to wait until the OS was heading towards obsolescence before making it free? Sigh)

(it’s just a pity it took so many years to reach this point, when e.g. in the USA, NASA has been making their content public domain for decades. All those high-res photos of space, nebulas, planets, etc – all free. For everyone)

But … it’s a pity they couldn’t find competent web-developers for their site http://www.ordnancesurvey.co.uk/:

Apart from the “I’m too lazy to write a web form properly” bug there, it also begs the question:

Why, in 2011, are you forcing people to use *EMAIL* to get a download link, instead of just downloading direct from the website?

I can think of a few possible explanations, but they all have simple solutions. So … I guess they’re all wrong. Otherwise, why hasn’t the OS done any of them :) ?

(oh, BTW: Ordnance Survey folks, you might want to run through your email-marketing database, and prune out any accounts you just created for: *you*are*incompetent*@*.com . Your crappy web-form not only failed to accept legal addresses, but it happily accepted email addresses that were blatantly fake)

And so … we have another Web 0.1 award :).

Categories
security server admin

Safe login on OS X: using an SSH key from a USB key/thumbdrive

I like computer security to be EASY and SECURE.

I hate passwords, and I use them rarely if at all. Instead, I use digital keys as much as possible (i.e. something based on a physical key stored on a removable USB drive that I take with me wherever I go). Like using a physical key, it’s much easier.

Sadly, OS X has a version of SSH that tries to be “too clever” while actually being “annoyingly unhelpful”. If you attempt to use a key from a removable drive, you get this error message:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for ‘login-key-for-tmachine.ssh’ are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: (key-name)
Permission denied (publickey).

(emphasis mine).

While it’s delightfully verbose, and tells you exactly what’s happened, it’s also a bit misleading. It says “WARNING” when it actually means “ERROR”, since the ssh system at this point deliberately stops itself. But, more importantly, it’s an error that you cannot evade under OS X. With OS X, all removable media has “Permissions 0777”.

Fortunately, there’s a workaround. Using this good but not-quite-detailed-enough article, I got most of the way there.

I had two problems, things that article omits.

Firstly, you are no longer “allowed” to edit /etc/fstab on OS X. Don’t try it. Instead, there’s a new command-line editor called “vifs” (hmm. vi-for-fstab, perhaps? :)) which works fine.

Secondly, the USB Drive I’m using has a space in the Label name. /etc/fstab uses spaces as a reserved character (I knew this), but … what do you write instead? (I didn’t know this).

I tried (and failed with):

  1. “My Drive”
  2. My\ Drive
  3. My Drive

…and with some creative googling, eventually found an example fstab with spaces in a label name. Aha!

  1. My\040Drive

i.e. replace spaces with “\040” (I’m guessing because it’s so low-level they’ve decided to “assume” unicode in all escape sequences)

…and now it all works as intended. Yay.