SSH keys from USB Stick
Yes, but not on a FAT filesystem. ssh
will only use private keys with permissions set to 400
or 600
, but FAT doesn't truly allow for this.
To get around this, I made several partitions on my USB key. This gives me a Linux partition for my OpenSSH keys, and a FAT partition for my PuTTY keys. I can then use ssh-add
/pageant to load the appropriate key, and connect without specifying my key location.
Related videos on Youtube
![Admin](/assets/logo_square_200-5d0d61d6853298bd2a4fe063103715b4daf2819fc21225efa21dfb93e61952ea.png)
Admin
Updated on September 18, 2022Comments
-
Admin almost 2 years
I have a couple of desktops, a couple of laptops and a netbook. Some of these devices still run windows. I use these machines to connect to Launchpad, where my projects are hosted. I'm really starting to fill up the SSH keys section on Launchpad, and I was wondering - if the SSH (private key) relates to me, then I should have a single identity right?
I know there is likely to be a religious flame war here, but I was wondering if I could do something similar to this : I'm wondering if I can create a USB stick - which literally has my certificate installed. This way as I move between machines I can just plug in the USB stick, enter the passphrase and I'm good to go. I could add Putty and the puttyAgent stuff (portable?) on there to allow me to run on windows machines.
This would reduce the number of ssh keys down to 1 - representing me, rather than
- me on a windows laptop
- me on the ubuntu session on that same laptop
- me on a netbook
- me on a desktop" and so on...
-
Admin over 9 yearsYes, it's possible. Bear in mind that PuTTY private key files (PPK) are in a different format to OpenSSH. They can contain the same key, but will need to be different files. Then just tell each machine to read from the USB key (using symlinks on Linux, and configuring Pageant on Windows appropriately). In fact, there's no need to use USB - if your key is passphrase protected, just copy it to each machine.