i wish to create a script based solution. i know the public key that a given device should have and i can use ssh-keygen to generate a fingerprint from that key. i consider it an error if the device has a different public key or fingerprint than those i already have in my possession.
i would like to populate the known_hosts file with an entry corresponding to the public key/fingerprint that i expect the device to have. i should point out that my known_hosts file is hashed. therefore, i cannot simply add the machine name to the public key. hashing adds some complexity that places a solution out of my reach.
other answers to similar questions have either suggested setting StrictHostKeyChecking to no or populating known_hosts using either ssh or ssh-keyscan.
being forced to answer 'yes' at the prompt when using ssh makes the script more difficult to code (this is precisely why i wish to seed the known_hosts file in advance).
ssh-keyscan asks the device for its public-key and fingerprint rather than using the public-key and fingerprint that i expect it to have.
finally, i do not wish to change the value of StrictHostKeyChecking.
i spent a lot of time researching other questions and answers. i hope that someone can offer a different solution.