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

Solution Verified - Updated -

Issue

  • 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.

Environment

  • 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, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content