Monday, March 9, 2009

HOWTO check an SSH host key

Check an SSH host key with:

ssh-keygen -lf /etc/ssh/ssh_host_rsa_key
Or, as a one-liner for both RSA and DSA:
find /etc/ssh/*{dsa,rsa}_key -exec ssh-keygen -lf {} \;
This also works with known_hosts, which is handy:

ssh-keygen -lf ~/.ssh/known_hosts

No comments: