11

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.

3
  • 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
    Commented Sep 30, 2021 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...
    – user462354
    Commented Oct 3, 2021 at 1: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. Commented Sep 2, 2023 at 13:26

3 Answers 3

20

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.

4
  • Same thing can happen on a Mac (for reasons not yet understood by me); this solution is helpful on MacOS, too.
    – jvb
    Commented Feb 18, 2022 at 8:33
  • 2
    I can confirm, it is useful for macos too but slightly different: gpg-agent --pinentry-program=/usr/local/bin/pinentry --daemon
    – sebbalex
    Commented Mar 2, 2022 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
    Commented Dec 15, 2022 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. Commented Sep 18, 2023 at 8: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.

0

In my case, I was using toolbx from Fedora Silverblue, and was inadvertently trying to decrypt from the environment/container:

⬢[username@toolbox ~]$ gpg --decrypt foo.asc

Exiting the environment/container and decrypting from the standard system/console environment fixed this issue:

username@system:~$ gpg --decrypt foo.asc

You must log in to answer this question.