Manual page for
sshd(8) describes the format of
Each line in these files contains the following fields: markers (optional), hostnames, bits, exponent, modulus, comment. The fields are separated by spaces.
If your public key for your host looks like this:
So just putting this line into your
your.host.name,0.0.0.0 ssh-rsa AAAA1234.....=
where you will exchange hostname and ip for your host.
Now it depends if you have
HashKnownHosts turned on. If not, you are done. Otherwise (e.g. on current Ubuntu releases) you will need to hash this file using
ssh-keygen -H -f ~/.ssh/known_hosts.