I had the same type of problem when attempting to decrypt using gpg2 on a remote host, logged in via ssh from Ubuntu 18.04 client. Turned out that GPG2 was unable to ask for passphrase via X-forwarding. I got it working by disabling X forwarding ("ssh -x .." or "unset DISPLAY"), which triggers a text-only pop-up asking for passphrase in the terminal.
-- You received this bug notification because you are a member of Ubuntu Bugs, which is subscribed to Ubuntu. https://bugs.launchpad.net/bugs/1775923 Title: gpg can't access secret keys when logged in via ssh instead of desktop To manage notifications about this bug go to: https://bugs.launchpad.net/ubuntu/+source/gnupg2/+bug/1775923/+subscriptions -- ubuntu-bugs mailing list ubuntu-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs