Search code examples
sshopensuse

ssh known_hosts are not hashed


I'm trying to setup some infra with docker on top of openSUSE:42.1.

And I found tha the ssh known_hosts are stored without hashed hostnames.

Why this happened?

$ cat ~/.ssh/known_hosts
[test001.myserver.com]:49160,[192.168.10.120]:49160 ecdsa-sha2-nistp256 AAAAE2VjZHNhLXNoYTItbmlzdHAyNTYAAAAIbmlzdHAyNTYAAABBBDn4hXOZcvL3LYvdpPDblx6cJCLZmF7rdeaJetaRe3rfQGmG4ldEkrFuZj44Y8RdVZxdUZFy9LkYrOqAsU7Y03k=

And If i manually insert it with hashed one like;

$ ssh-keyscan -t rsa -p 49160 -H test001.myserver.com,192.168.10.120 >> ~/.ssh/known_hosts

it complains with below message.

Are you sure you want to continue connecting (yes/no)?

Solution

  • Thank you. I put HashKnownHosts yes in /etc/ssh/ssh_config and it works.