~/.ssh/authorized_keys[2] contains the list of public keys.
Unfortunately, each public key does not specify the key strength ( number of bits ).
Is there a utility that can process this file line by line and output the key strength?
I checked man pages for ssh-keygen
, but it looks like it would only work with private keys.
Also, is there a tool that would output sha1 hash the same way as it is displayed in pageant
Putty tool?
The format I am looking for:
Key Algorithm Strength Hash Comment
ssh-rsa 2048 00:11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff user1@host1
ssh-rsa 2048 11:22:33:44:55:66:77:88:99:aa:bb:cc:dd:ee:ff:11 user2@host2
Best Answer
ssh-keygen can do the core of the work (generating a fingerprint from a public key), but it will not automatically process a list of multiple keys as is usually found in an
authorized_keys
file.Here is a script that splits up the keys, feeds them to ssh-keygen and produces the table you want: