Take Your Keys With You

Now that you have created keys for logging into you servers, you might find that you are moving between systems, or you just don’t like leaving your keys behind when you go home. There is a quick fix for this.

If you have a USB thumb drive around, you can use this to transport your keys. You really only need a very small amount of storage for this, so all of those free thumb drives and old ones that you didn’t know what to do with can have new life.

Your keys are stored in the .ssh directory in your home directory. So the first thing you are going to do is move that directory to your thumb drive.

    cd ~
    mv .ssh /Volumes/<name of your thumb drive> 

Next you need to establish a symbolic link (much like an alias) to the .ssh directory on your thumb drive.

    ln -s /Volumes/<name of your thumb drive> .ssh

You can type in

    ls -al

To see the link in place.

I would recommend making a backup of your thumb drive as they are easy to lose and aren’t the world’s most reliable storage medium. Also you should only do this with keys that use a passphrase in case it falls into someone else’s hands. You might want to think about creating an encrypted image on your thumb drive to store the keys to add an additional layer of protection.

You might also want to move your gpg or pgp keys onto a thumb drive in the same manner.


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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s

%d bloggers like this: