10

I can't decrypt my passwords with pass neither with gpg directly.

gpg: encrypted with rsa4096 key, ID id, created creation_date
      "name <email>"
      gpg: public key decryption failed: No pinentry
      gpg: decryption failed: No pinentry

It does not show a prompt dialog asking for the master password.

It says "no pinentry" but the program is installed:

$ ls /usr/bin/pinentry*
/usr/bin/pinentry
/usr/bin/pinentry-curses
/usr/bin/pinentry-emacs
/usr/bin/pinentry-gnome3
/usr/bin/pinentry-gtk-2
/usr/bin/pinentry-qt
/usr/bin/pinentry-tty

Please, I need help asap because I can't login into nothing without my passwords, which are all encrypted with GPG.

  • Quite a wild guess, but the issue might be in the configuration of your gpg-agent. You may be able to work around it with gpg ... --pinentry-mode=loopback .... A complete answer will likely require more information about your system: which OS are you using? Which version of gnupg? Is there any reference to pinentry in your gpg.conf or gpg-agent.conf? How is gpg-agent activated? – fra-san Sep 30 '21 at 18:52
  • Hi! Thanks for the help. So, what I ended up doing was this: pkill gpg-agent followed by gpg-agent --pinentry-program=/usr/bin/pinentry-gtk-2 --daemon and it worked. I don't know id hadn't worked before, but glad I was able to solve it... –  Oct 03 '21 at 01:10
  • Not explicitly mentioned here, but I got no pinentry message when using pinentry-dmenu, with pinentry-program /usr/bin/pinentry-dmenu in $HOME/.gnupg/gpg-agent.conf and while having no pinentry-dmenu.conf file. Using >$HOME/.gnupg/pinentry-dmenu.conf to create empty pinentry-dmenu.conf solved the problem for me. It seems that if, for whatever reason the pinentry program errors out, it causes this error. – Vilinkameni Sep 02 '23 at 13:26

2 Answers2

17

I solved the problem by running the following commands

pkill gpg-agent
gpg-agent --pinentry-program=/usr/bin/pinentry-gtk-2 --daemon

and it worked. I don't know why pinentry wasn't working, but starting a new gpg-agent daemon has worked.

  • Same thing can happen on a Mac (for reasons not yet understood by me); this solution is helpful on MacOS, too. – jvb Feb 18 '22 at 08:33
  • 2
    I can confirm, it is useful for macos too but slightly different: gpg-agent --pinentry-program=/usr/local/bin/pinentry --daemon – sebbalex Mar 02 '22 at 14:04
  • 1
    thanks for this answer! I needed first to figure out which pinentry software is available on my system. For that I used ls -l /usr/bin/pinentry* – ingli Dec 15 '22 at 22:44
  • 1
    On Fedora 38 with Gnome 44 it was enugh to just pkill gpg-agent, then running pass (gpg password manager) automatically spawned the gnome pinentry like normal. – Stefan Midjich Sep 18 '23 at 08:25
1

I encountered this error because I had pinentry-qt configured in my ~/.gnupg/gpg-agent.conf but did not have qt installed. Choosing a different pinentry solved the issue.

Schlueter
  • 151