Nifty OpenSSH 4.0 feature


I was reading through O’Reilley’s OnLamp today, and came across their interview with the OpenBSD developers. In the interview, Dave Miller discussed the new features in OpenSSH 4.X, and described the following awesome new feature:

“Added the ability to store hostnames added to ~/.ssh/known_hosts in a hashed format. This is a privacy feature that prevents a local attacker from learning other hosts that a user has accounts on from their known_hosts file.”

So instead of hostnames being stored in plain text like:

yourhost.example.com ssh-rsa AAAB3NzaC1yc2EAAAABIwAAAIEAp832eeMwYH…

They are hashed first, so they don’t reveal the hostname. E.g.:

|1|bRGYyrC+bfKZGGd5GZH4wo1AnsI=|xcQ+54QNVwQ+fBCldn0= ssh-rsa AAA…

We added at the request of some MIT researchers who found that a substantial number of user private keys on shared systems are not encrypted (a really dumb thing to do, BTW). This lack of user care, coupled with the information in the known_hosts files, allowed attackers to spread their attacks to multiple systems.

Right now this is disabled by default, but administrators of sites with lazy users can turn it on with the HashKnownHosts config flag.

If you do this, you should probably also hash your existing known_hosts file (ssh-keygen -H).”

I sometimes think I am the only person that uses ssh-agent to store private keys in memory, and strong complex passwords to protect keys on disk. While a competent attacker would use a packet analysis tool to find SSH destinations, this may protect admins in select situations.

This article was posted by Matty on 2005-10-13 01:05:00 -0400 -0400