How to use GnuPG (gpg or gpg2) to generate a PGP key that isn't protected by a passphrase

Solution Verified - Updated -


  • How can I create a PGP keypair with gpg or gpg2 that can be used for decryption and signing without requiring a passphrase?

  • Can GnuPG create private keys that aren't encrypted?

  • Can GPG remove the password from a private key so that the key can be used without any prompting?

  • Cannot get gpg keys without a passphrase to work. I need to be able to automate gpg encryption of files and decryption without a passphrase.


  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 5

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In