how to add a passphrase to a keypair

raf gnupg at raf.org
Sun Oct 3 04:40:03 CEST 2021


On Sat, Oct 02, 2021 at 07:12:45PM -0400, Jack via Gnupg-users <gnupg-users at gnupg.org> wrote:

> Is it possible to add a passphrase to a secret key originally created
> without one?  If so, please tell me how.  I'll be happy with either
> instructions or pointer to the fine manual I either missed or misread.
> 
> I have tried lots of variations.  Attempts using gpg-agent fail because
> pinentry (I've tried text and gui versions) refuses to accept a blank
> passphrase.  Variants using --passphrase or --passphrase-fd don't work
> because they only allow passing one passphrase, and I need to provide the
> old one and the new one.  I've also tried --export-secret-key, which also
> fails with "error receiving key from agent: No passphrase given - skipped"
> when using --passphrase-fd.
> 
> I do have a copy of gpg-1.4.23 available, but simply copying .gnupg to a new
> user and using the old gpg doesn't help because gpg1 doesn't see the secret
> keys from gpg2, and I haven't been able to export them.
> 
> Is there a way to do this, or is revoking the old key and creating new keys
> from scratch the only solution?
> 
> Thanks for any information.
> 
> Jack

Try these instructions for changing the passphrase:

  https://www.cyberciti.biz/faq/linux-unix-gpg-change-passphrase-command/
  https://help.ubuntu.com/community/GnuPrivacyGuardHowto#Changing_your_Passphrase

  gpg --edit-key Your-Key-ID-Here
  gpg> passwd
  gpg> save

cheers,
raf




More information about the Gnupg-users mailing list