I consider best practice to be using a hardware token. My favoured solution is to use a yubikey via gpg: with this method you use your gpg subkey as an ssh key. The yubikey 4 supports RSA 4096 bit keys, if you need NFC then the Yubikey Neo supports max RSA 2048 bit keys.
Ask HN: What are the best practises for using SSH keys?
31–40 of 114 posts
Re: Ask HN: What are the best practises for using SSH keys?
#32Re: Ask HN: What are the best practises for using SSH keys?
#33From my experince as an attacker -- - Is it better to use a different passphrase on each key, or does using the same one not matter much? - How much less secure is it to not use a passphrase on a key? - Should you use a different key per user account, per server, or per use-case (i.e. personal or work)? None of these things really matter that much. Make sure you use full disk encryption and never stand up from your m…
Why are ED25519 keys better than RSA, how compatible are they with different systems, and are they worth the hassle and risk of generating and using a new one?
Re: Ask HN: What are the best practises for using SSH keys?
#34If you use fail2ban make sure to pin the right key to the right host. Otherwise ssh will try all the keys and get you banned from your own host. The easiest way is to use the ~/.ssh/config: Host myhost IdentityFile ~/.ssh/myhost
Re: Ask HN: What are the best practises for using SSH keys?
#35From 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 that a compromised passphrase
on one device can be transferred by an attacker to another.
- Similarly, whether a blank passphrase is a good idea or
not depends on what other measures are protecting access
to that private key.
- If a private key ever turns up on the wrong machine,
you *know* the key and both source and destination
machines have been compromised.Re: Ask HN: What are the best practises for using SSH keys?
#36Re: Ask HN: What are the best practises for using SSH keys?
#37https://github.com/philipWendland/IsoApplet + some blank java cards + card reader. Something about Yubico rubs me the wrong way.
Use a GPG Card - much simpler than acquiring blank Java cards.
Re: Ask HN: What are the best practises for using SSH keys?
#38Earlier quoted context omitted.
> It is better to use a different passphrase for each key but it is also less convenient unless you're using a password manager (personally, I'm using KeePass) If you are going to use a password manager to store them there's no point in using different passphrases.
Why not? Granted the passphrase are in one place but as long as your password store doesn't get compromised managing to brute force a key's password then only gives you access to the machine(s) that one key is accepted on. Also, the keys don't have to reside on the same device the password store is on. If you have one key per client device for example.
Re: Ask HN: What are the best practises for using SSH keys?
#39From my experince as an attacker -- - Is it better to use a different passphrase on each key, or does using the same one not matter much? - How much less secure is it to not use a passphrase on a key? - Should you use a different key per user account, per server, or per use-case (i.e. personal or work)? None of these things really matter that much. Make sure you use full disk encryption and never stand up from your m…
Nobody seemed to answer this question, and neither did the original blog post (besides "trust me and do it"), so maybe you can shed more light on the main point: Why are ED25519 keys better than RSA, how compatible are they with different systems, and are they worth the hassle and risk of generating and using a new one?
OpenSSH already has support built in, as does Mosh, and therefore, I do think it's worth it.
I do sometimes disagree with using keys though, despite everyone pushing it so hard, there are cases where I think passwords are the way to go, but thats a long post for another time.
Also, I really like usin pam auth mods, such as yubikeys or google auth for two factor. That combined with regular hardening, and yes Ill admit it, non standard ports (reduces log alert fatique) does a pretty good job.
Re: Ask HN: What are the best practises for using SSH keys?
#40From my experince as an attacker -- - Is it better to use a different passphrase on each key, or does using the same one not matter much? - How much less secure is it to not use a passphrase on a key? - Should you use a different key per user account, per server, or per use-case (i.e. personal or work)? None of these things really matter that much. Make sure you use full disk encryption and never stand up from your m…
Nobody seemed to answer this question, and neither did the original blog post (besides "trust me and do it"), so maybe you can shed more light on the main point: Why are ED25519 keys better than RSA, how compatible are they with different systems, and are they worth the hassle and risk of generating and using a new one?
Two reasons: 1) they are a lot shorter for the same level of security and 2) any random number can be an Ed25519 key. To generate an RSA you have to generate two large random primes, and the code that does this is complicated an so can more easily be (and in the past has been) compromised to generate weak keys.