I am trying to install Pass: the standard Unix password manager, however, when I try to add passwords to the appliation I get these errors

gpg: Kelly's Passwords: skipped: No public key
gpg: [stdin]: encryption failed: No public key

GPG Public Keys?

When I type in the command gpg --list-keys I get:

pub   2048R/64290B2D 2012-11-05
uid                  Kelly Hays <hays.kelly@gmail.com>
sub   2048R/0DF57DA8 2012-11-05

I am a little lost of how to remedy this, any ideas?


How did you create the password store? pass init "Kelly's Passwords"? If so, this is wrong, you should have called pass init 64290B2D.

And if then pass insert foo will fail with:

gpg: fooo: skipped: public key not found
gpg: [stdin]: encryption failed: public key not found

then you have to trust your own key first (gpg --edit-key 64290B2D, trust, 5, save).

  • I'll just add for those who were one step behind like me, you should first init gpg key with gpg --generate-key – ItayB Jun 19 '17 at 5:43
  • 1
    @ItayB the command to generate a gpg key is actually gpg --gen-key (in gpg 1.4.20) – Rubanov Jul 13 '18 at 8:17

With the same indications, if anyone stumbles across this issue, the solution may be bit different. Your pass is using gpg2 instead of gpg, you might have used to generate/manage your keys (or, vice-versa). Verify with:

bash -x $(which pass) insert foo
  • 2
    WTF!? Why are both gpg and gpg2 installed on a fresh system? Why neither the pass manpage nor its website care to mention how to create the !@#&% damned gpg key??? – Tobia Dec 29 '16 at 16:43
  • 2
    In case one has already generated a with GPG 1 - you can import it into GPG 2 like this: gpg2 --import ~/.gnupg/secring.gpg – maxschlepzig Apr 15 '17 at 12:19

I got the same error for while, running the bash in debug is helping. ( bash -x ), I then realized that pass had listed a non-existing gpg-key in .password-store/.gpg-id


I got the same error, but checking with gpg2 --list-keys gives me

pub   rsa4096/0x12345678 2016-11-22 [SC] [expired: 2018-11-26]

So my solution is to

gpg --edit-key 0x12345678
gpg> expire
gpg> save

See https://unix.stackexchange.com/a/177310/14315

If you have to renew subkeys use this:

e.g. if the subkey whose validity you want to extend is the first listed subkey, or if it is the only listed subkey, then the command would be Command> key 1 this will put a * after the word sub, indicating that this particular subkey has been selected. then Command> expire and follow the prompts.

Source https://lists.gnupg.org/pipermail/gnupg-users/2005-June/026063.html

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.