I'm building my custom distribution for RPi using Yocto. My distro includes ssh server (dropbear, but the question is valid for openssh also)
One of the annoying things that I notices is that every time I flash a newly-built image to the board, I get a new SSH host key, which in turn causes my ssh client to warn me that the server's host key has changed, and I need to remove the server's fingerprint from /etc/known_hosts
.
I wonder if there is a built-in mechanism for supplying secrets for the build-system without putting them into source-control.
More specifically - is there a way to tell yocto "take this key file as the host key for dropbear/sshd
"?