SSH Keys on a USB jump drive on Mac OS X (Mountain Lion Edition)


Here I address the eternal struggle.

I want to store all my private keys on my jump drive I wear around everywhere. I use Win, Linux, but primarily Macs to do to my work so it needs to be some FAT variant formatted. I want to use the absolutely least hacky way.

Windows and Linux were easy to overcome. In short for windows you use putty to make a putty key and in linux you do something shockingly similar to what is below… but I get ahead of myself.

All the searches in duck duck go and google came up with “Nope! Can’t do it! Give up!” for the Mac. All these people are horrible liars and don’t want you to succeed. After figuring this out it was REALLY EASY as long as you are terminal competent. If you aren’t terminal competent I’m not sure why you read my blog, I’d assume most of my stuff is really flying over your head.

As always YMMV and don’t copy paste things I write here into the terminal.

tl;dr jump point

  1. Find your uid with “id -u”. 99% of the time it’s 501.
  2. Double check your drive name with “ls -ln /Volumes”.
  3. with sudo add a new line to /etc/fstab1

    #Drive called iamaKey and user 501
    LABEL=iamaKey none msdos -u=501,-m=700
    

There is no step 4; eject & replug your key to enjoy ssh keys used directly from drive.

Considerations


  1. On a new 10.8 machine /etc/fstab does not exist. You must create a fresh file as root.
comments powered by Disqus