How do I know if *.pem is password protected using ssh-keygen?

ssh-keygen -y -f myfile-privkey.pem

If the key is password protected, you will see a “password:” prompt.

The flags in this command are:

-y Read private key file and print public key.
-f Filename of the key file.

As extra guidance, always check the command someone, especially online, is telling you to use when dealing with your private keys.

Leave a Comment