5 ms·
Of course, this doesn't address what I consider the greatest weakness in using ssh - distribution of host keys. By design, ssh does not make use of certificate
by js2 13y ago
Of course, this doesn't address what I consider the greatest weakness in using ssh - distribution of host keys.
By design, ssh does not make use of certificates. So there is no way for ssh to know upon connecting to a host for the first time whether the public key presented by that host is authentic. After the first connection, ssh caches the keys in ~/.ssh/known_hosts, and will then give you a big warning if the key changes. I imagine when this happens many folks blindly delete the the cached key and re-connect.
So you should be aware of the potential for MITM attacks to occur unless you have some out-of-band mechanism for distributing or authenticating host keys.
Edit: huh, apparently ssh added support for certificates. "ssh-keygen supports signing of keys to produce certificates that may be used for user or host authentication." So now you just need to distribute your CA certificate everywhere and you're golden. http://justanothergeek.chdir.org//2011/07/howto-authenticate-ssh-server-through/ http://justanothergeek.chdir.org//2011/07/howto-authenticate...
- mike-cardwell 13y agoYou can put SSHFP records in the DNS. See "VerifyHostKeyDNS" in the SSH man page. You'll also want DNSSEC set up of course.
- peterwwillis 13y agoAfter you get a validating stub resolver, since your OS probably doesn't ship with one by default.
- mike-cardwell 13y agoDoesn't take long to do an "apt-get install unbound" and then modify your network settings to use 127.0.0.1 as your resolver.
- rscale 13y agoAnd if you're using a DNS service that doesn't support SSHFP records, you can generate and distribute a base known_hosts file with your favorite configuration management solution.
- peterwwillis 13y agoSo now you just need to distribute your CA certificate everywhere As opposed to writing down the key signature of your server's host keys on a card in your wallet? You only need to look at it the first time you connect to the server, and it's a lot less of a pain in the ass than trying to install custom CA certs on every machine you SSH from.
- hamburglar 13y agoIf you have one server, that sounds great. If you have 60, it does not.
- calpaterson 13y agoIf you have 60 servers you are hopefully using some kind of configuration automation, like puppet or chef...?
- hamburglar 13y agoYes, but in my experience, doing that for client machines (where you need to check the fingerprints) is pretty atypical.
- parfe 13y agoFor the love of god why have 60 servers with ssh available open to the world? Ssh through trusted gateway machine! Then you need a single signature you trust and you can firewall off the rest of your hardware.
- hamburglar 13y agoFor the love of god why would you assume this has anything to do with "open to the world"? When I proxy through the trusted ssh gateway to the firewalled servers (using ssh ProxyCommand), I still like my client to verify the signature.
- 13y ago
- zobzu 13y agoWhile many suggestions are correct, i also like the monkey-sphere one because its based on GPG trust model. With the CA you have to have a base trust in a CA cert, with GPG you trust whatever you want.
- insertdisktwo 13y agoEven though MITM is a very important attack vector, we've seen recently how the strength of the private key file encryption can overnight come under scrutiny of world-wide IT media (spoiler: Linode private key has a 'secure' password): https://blog.linode.com/2013/04/16/security-incident-update/ https://blog.linode.com/2013/04/16/security-incident-update/