Live data from Hacker News

Ask HN: How do you manage your private keys?

news.ycombinator.com

1–10 of 20 posts

Ask HN: How do you manage your private keys?

#1
I'm sure many here need to juggle different servers or services between jobs, clients, playgrounds, and projects.

1. How do you organize your private key(s)? One for all, one per client, one per project, one per client/project/machine?

2. How do you move your keys between devices/machines? USB copy? File in password manager? Something like Keybase? This point is obviously moot if you have different keys per device.

Personally, I'm trying to segment my projects logically and share keys as little as possible, but not to the point of obnoxiousness. I certainly try to keep devices separated in case one gets compromised.

As for key management, I've been simply keeping them in directories, but I've been looking into Keybase's git integration lately for that, hence the question.

Re: Ask HN: How do you manage your private keys?

#5
post #3

Don't copy your keys. Don't manage or "organize" your keys. Don't share your keys. The leaky abstractions around what you're doing with keys is a security illusion, and you need to stop.

This is a pretty good example of a useless comment. Telling the person to simply stop doing what they are currently doing is not a solution. Perhaps, instead, you could offer a different way to handle the situation outlined by the question.

Re: Ask HN: How do you manage your private keys?

#6
post #3

Don't copy your keys. Don't manage or "organize" your keys. Don't share your keys. The leaky abstractions around what you're doing with keys is a security illusion, and you need to stop.

This is a pretty good example of a useless comment. Telling the person to simply stop doing what they are currently doing is not a solution. Perhaps, instead, you could offer a different way to handle the situation outlined by the question.

Sorry.

Generate new keys for each service, device, client, and server. Don't share them. Don't copy them.

Re: Ask HN: How do you manage your private keys?

#7
I segment my private keys into two broad groups -- ones I use for certs and long-term crypto, and ones I use for encrypted communications. The cert/long-terms keys are kept on a flash drive (plus a backup drive kept elsewhere) that is under physical lock and key when not actively needed.

The comms crypto keys are kept on a different flash drive that I'm less rigorous about, as I need to have it handy in order engage in the communications. I mitigate this loss of rigor by replacing them reasonably frequently.

All the flash drives involved are encrypted themselves, as well.

Re: Ask HN: How do you manage your private keys?

#8
I always generated new keys on new devices. I never moved a private key off the device where it was generated. It just felt like doing so creates all sorts of opportunities for mistakes and loss. While it's more work to add or rotate public keys than it is to move private keys, IMO it's also safer.

When I had to manage keys for a bunch of servers and services, at first I segmented them by scope of potential compromise. For example, I had one key pair for my hosting environment, and a separate one for Github, since I had access to more repos than just the apps I was hosting.

But eventually I stopped doing that because the weak point was the device; if my device was stolen, so were all the private keys, no matter how many there were. So, might as well just have one key per device.

I always set passwords on my private keys, and stored the password in an encrypted file: either KeePass, or Keychain on my Mac.

I managed all my SSH hosts a .ssh/config file, so I could connect on the command line with just a nickname.

Edit: this was all to manage an infrastructure for developing and hosting a few dozen websites.

Re: Ask HN: How do you manage your private keys?

#9
post #6

Earlier quoted context omitted.

This is a pretty good example of a useless comment. Telling the person to simply stop doing what they are currently doing is not a solution. Perhaps, instead, you could offer a different way to handle the situation outlined by the question.

Sorry. Generate new keys for each service, device, client, and server. Don't share them. Don't copy them.

This still isn't very useful. Suppose you have a database, and an elastic number of workers that need to connect.

Re: Ask HN: How do you manage your private keys?

#10

I always generated new keys on new devices. I never moved a private key off the device where it was generated. It just felt like doing so creates all sorts of opportunities for mistakes and loss. While it's more work to add or rotate public keys than it is to move private keys, IMO it's also safer. When I had to manage keys for a bunch of servers and services, at first I segmented them by scope of potential compromis…

[deleted]
Post reply on HN