I've got a whole pile of SSH keys here, public and private. How do I find out which private keys require a password, and which don't?

link|improve this question

79% accept rate
feedback

2 Answers

up vote 6 down vote accepted

Assuming you're talking about OpenSSH format keys:

$ grep ENCRYPTED *id*
test2.id:Proc-Type: 4,ENCRYPTED
id_dsa:Proc-Type: 4,ENCRYPTED

It's simpler than you might expect :)

$ head test.id
-----BEGIN RSA PRIVATE KEY-----
MIIEoAIBAAKCAQEAogi+ ...

$ head test2.id
-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
...
link|improve this answer
feedback

Encrypted private keys will contain the line:

Proc-Type: 4,ENCRYPTED
link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.