If you have too many machines and you are nearly always asked about a host key when you connect, it leaves an opening that the first time you connect to a machine it's a security threat, but anytime after that it is not and you need to pay attention if the key isn't the same as it may be a man-in-the-middle attack.

So if you've never connected to these machines before and you have in excess of 1000 machines, the probability is high that it will take a really long time to connect to them all, so how does one ensure that the correct keys are already in place so that the keys which do not match are not ignored?

Note: this question was prompted by my asking this question.

  • Fantastic question. Could the question be summarized as "Looking for SSH key management tricks that apply to a large fleet of machines to reduce the 'trust of first use' attack surface." ? I'm picturing a framework whereby part of the first-time boot process for these machines is to add its key to a centralized known_hosts file. No idea if that exists, or if it can be done securely. Dec 10, 2018 at 1:00
  • 2
    Have you looked into OpenSSH Certificate Authentication? It should allow signing host keys with a CA key, which you then distribute.
    – Daniel
    Dec 10, 2018 at 6:25

1 Answer 1


There is no need for tricks, SSH Certificate Authority is designed for exactly this kind of situation.

You install host certificates signed by the Certificate Authority, distribute the Root Certificate to your users, and your users are connecting securely from the first connection.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .