How to tell if key is encrypted?

Bob Proulx bob at
Fri Nov 21 18:25:05 EST 2003

I would like to automatically deduce in a script if an ssh key is
encrypted or not.  Basically in a very particular application I want
to be the BOFH and enforce that users place a passphrase on their
id_rsa key.  If they don't put a passphrase I want to send them back
to ssh-keygen until they do.  I have not been able to deduce a way to
detect this yet.  Any hints?


More information about the openssh-unix-dev mailing list