vendredi 25 janvier 2019

Check SSH key locally

ssh-keygen -lf <pubkey_file>

ex : ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub

Also use :
ssh-keyscan 127.0.0.1 | ssh-keygen -lf -

on remote :
ssh-keyscan <remote> | ssh-keygen -lf -


If needed to get it in md5 hashing algorythm :
for file in ~/.ssh/*.pub; do ssh-keygen -lf $file -E md5 -g; done