Live data from Hacker News

Ask HN: What are the best practises for using SSH keys?

news.ycombinator.com

101–110 of 114 posts

Re: Ask HN: What are the best practises for using SSH keys?

#101

Earlier quoted context omitted.

In addition, it might be a good idea to think about a system that can update/rotate your keys across all of your servers on the fly in case the third-party service you're using to manage the keys to the kingdom is compromised or assumed to be compromised.

Sorry to hijack this, but this is absurd. I really must have missed the story here -- people pay for a third party service to manage their private keys? ... Err. That's so illogical it's making my brain hurt to even work out why I would need to explain how illogical it is... I can't even come up with a good analogy for how wrong that whole idea is, fortunately I don't have to though since no one that has mastered 'ss…

> Do I even need to explain why this is blowing my mind so much?

Not to me, I felt exactly the same way.

I simply cannot fucking believe that somebody would "outsource" something as sensitive as this. Then again, I don't run my services on other people's computers either. My servers are either in our cages in datacenters or in buildings that we own, they're locked down as much as I can get them (DISA STIGs, etc.), we encrypt the hell outta data, we have strict security policies, etc.

I really can't imagine doing something this crazy but clearly I'm in the minority.

Re: Ask HN: What are the best practises for using SSH keys?

#102
I upgraded to ed209 the other day as well.

Two questions came up, how many iterations to use via "-a ", and should I add the private key to my home folder repo in version control? I don't want to lose it in a disk crash, but don't want to give it to bithub either.

Re: Ask HN: What are the best practises for using SSH keys?

#103

Earlier quoted context omitted.

Userify is available as on-premise too. (btw I strongly agree with you... we're offering 5 server enterprise license model and we're looking at an unlimited stripped-down free version.) Also, you're probably running servers at a third party hypervisor already.. ;) they could be scanning your RAM and reading your disk and you'd never know.

Yeah, actually I'm not. All of my servers are either in our own cages in datacenters or housed in buildings that we own. We don't do AWS/DigitalOcean/etc. (Nice attempt at a jab, though.) I certainly wasn't trying to shit on you (or your company/employer) personally... but to me the idea of turning over ultimate control of all my servers, data, etc., to some unknown third-party and simply trusting them is absolutely…

"unknown third-party and simply trusting them is absolutely fucking absurd"

So how do you feel about TLS and the 100's of trusted certificates embedded in your browser/mobile device?

Re: Ask HN: What are the best practises for using SSH keys?

#104

Earlier quoted context omitted.

Yeah, actually I'm not. All of my servers are either in our own cages in datacenters or housed in buildings that we own. We don't do AWS/DigitalOcean/etc. (Nice attempt at a jab, though.) I certainly wasn't trying to shit on you (or your company/employer) personally... but to me the idea of turning over ultimate control of all my servers, data, etc., to some unknown third-party and simply trusting them is absolutely…

"unknown third-party and simply trusting them is absolutely fucking absurd" So how do you feel about TLS and the 100's of trusted certificates embedded in your browser/mobile device?

Are you really asking the difference between the CA bundle and some node+redis+python startup being able to drop authorized_keys across your datacenter?

... eh?

Re: Ask HN: What are the best practises for using SSH keys?

#105
post #6

Some general advice based on most requirements. - Is it better to use a different passphrase on each key, or does using the same one not matter much? If they are being used on different device then different passphrases makes sense otherwise no. - How much less secure is it to not use a passphrase on a key? 10? Not sure you can really quantify an answer. I'd recommend a passphrase if you aren't already using disk enc…

Don't use DSA

Re: Ask HN: What are the best practises for using SSH keys?

#106

Earlier quoted context omitted.

"unknown third-party and simply trusting them is absolutely fucking absurd" So how do you feel about TLS and the 100's of trusted certificates embedded in your browser/mobile device?

Are you really asking the difference between the CA bundle and some node+redis+python startup being able to drop authorized_keys across your datacenter? ... eh?

The original conmment was about "unknown third parties". I'm not advocating handing over your ssh keys to anyone but if you did, at least this would be a third party you consciously chose to trust. The crap load of CA's you implicitly trust on the other hand... Do you even know the names of 10 out of about 200 of them embedded in your browser?

EDIT: Case in point.. did you know the name WoSign before they became notorious? https://docs.google.com/document/d/1C6BlmbeQfn4a9zydVi2UvjBG...

Re: Ask HN: What are the best practises for using SSH keys?

#107

The first rule: never share a private keys between physical devices. Apart from reducing the opportunities for it to go walkies in transit, or accidentally get left on a USB stick, it allows you to revoke a single credential if you lose (control over) that device. From that, we get: - you're not sharing passphrases between keys, you're sharing them between devices, and whether that's safe depends how likely it is tha…

If I understand this properly, how do you use the same identity from two different machines on a service like github?

If they only allow you to upload one public key per account, then you aren't able to use that account on both your desktop and laptop, if you have separate private keys on them, no?

Edit: Actually I just looked at github and they allow multiple keys. Is it generally the case that any service that offers ssh keys will allow multiple keys?

Re: Ask HN: What are the best practises for using SSH keys?

#108
post #83

Earlier quoted context omitted.

If I understood it correctly, you're saying that RSA requires the two numbers to be big AND random, otherwise the algorithm isn't strong? Therefore Ed25519 is better because it's strong regardless of the key? What I don't get then is how can a short key be secure, that goes against what I was taught in college. Aren't shorter keys more prone to collisions and bruteforce attacks?

RSA requires two numbers which are big and random and prime . It is the primality that makes things tricky. Generating random primes is a lot harder than generating random numbers . The other factor (no pun intended) that makes RSA keys large is that there are more efficient algorithms for factoring than there are for solving the elliptic curve discrete log problem, e.g. https://en.wikipedia.org/wiki/General_number_f…

Not disagreeing, but I think both randomness and primality testing both have the problem that it's so easy to do them poorly. Generating random primes of these sizes isn't all that difficult, and even proofs can be done in reasonable time frames (e.g. under 10 seconds for 1024-bit inputs). There are also a couple random proven prime algorithms which run pretty fast. Getting software to correctly implement everything .... that seems to be hard.

Re: Ask HN: What are the best practises for using SSH keys?

#109
post #108
post #83

Earlier quoted context omitted.

RSA requires two numbers which are big and random and prime . It is the primality that makes things tricky. Generating random primes is a lot harder than generating random numbers . The other factor (no pun intended) that makes RSA keys large is that there are more efficient algorithms for factoring than there are for solving the elliptic curve discrete log problem, e.g. https://en.wikipedia.org/wiki/General_number_f…

Not disagreeing, but I think both randomness and primality testing both have the problem that it's so easy to do them poorly. Generating random primes of these sizes isn't all that difficult, and even proofs can be done in reasonable time frames (e.g. under 10 seconds for 1024-bit inputs). There are also a couple random proven prime algorithms which run pretty fast. Getting software to correctly implement everything…

> Getting software to correctly implement everything .... that seems to be hard.

Exactly. Generating random primes is not terribly difficult in theory, but in practice it is very tricky, which makes it hard to answer the question: how do you know you can trust your keys? Sure, you can verify that your primes are prime, but how do you know how much entropy they have? The only way to figure that out is the audit the code. (And then you have the problem of making sure that the code you're running is the code you audited.)

Generating random numbers is also tricky, but a lot less so than generating random primes: take an entropy source and run it through a whitener, i.e. feed it to sha512. As long as you have a reliable estimate of the lower bound of the quality of your entropy source, you're good. A lot fewer moving parts.

Re: Ask HN: What are the best practises for using SSH keys?

#110
post #56

Earlier quoted context omitted.

Because if your password manager is compromised, so are all of the passphrases stored in it. So what would the point, then, be of using different ones?

So because a password manager is one-stop shopping (something that I'm subconsciously uneasy about, to be sure), it's pointless to use different passphrases, one of the major selling points of password managers. So to protect against that, don't use a password manager. Which means that you're more likely to re-use passphrases, because lots of them are hard to remember and keep straight. So breaking one gets access to…

The compromise I use is to break the cycle: Use a password manager to generate strong passwords (and different ones, because breaches happen), and use a hardware token-based password for the manager itself. At least that's the compromise I'm comfortable with.
Post reply on HN