A página de manual para sshd
descreve o formato do arquivo:
SSH_KNOWN_HOSTS FILE FORMAT
The
/etc/ssh/ssh_known_hosts
and~/.ssh/known_hosts
files contain host public keys for all known hosts. The global file should be prepared by the administrator (optional), and the per-user file is maintained automatically: whenever the user connects from an unknown host, its key is added to the per-user file.Each line in these files contains the following fields: markers (optional), hostnames, bits, exponent, modulus, comment. The fields are separated by spaces.
[...]
Alternately, hostnames may be stored in a hashed form which hides host names and addresses should the file's contents be disclosed. Hashed hostnames start with a ‘|’ character. Only one hashed hostname may appear on a single line and none of the above negation or wildcard operators may be applied.
Exceto que a parte bits, exponent, modulus
agora é usada em conjunto como chave pública. O nome do host está com hash, mas você pode escrevê-lo como uma string e, em seguida, executar ssh-keygen
sobre o arquivo:
ssh-keygen -H [-f known_hosts_file]
por exemplo, ssh-keygen -H -f ~/.ssh/known_hosts