gpg-agent only works when started in terminal

Stephan Beck stebe at mailbox.org
Fri Sep 9 11:55:00 CEST 2016


Hi Antony,

just some ideas to (possibly) track it down...

Antony Prince:
> I know this has got to be something simple. When invoking gpg2 normally
> to decrypt, I get:
> 
> gpg: encrypted with 4096-bit RSA key, ID 0E98CD22ADB13E99, created
> 2015-05-06
>       "Antony Prince <antony AT blazrsoft.com>"
> gpg: public key decryption failed: No pinentry
> gpg: decryption failed: No secret key

AFAIK, this means that the agent is not started when you "invoke gpg2
normally" (directly from the command line?), so the environment may be
incorrectly set. Or is there more than one agent instance running?
What does a
gpg-agent --daemon --write-env-file
output in terms of GPG-AGENT_INFO?
Is the correct socket being used?
> 
> I have pinentry-program set properly in ~/.gnupg/gpg-agent.conf.

And you symlinked /usr/bin/pinentry and the pinentry you might actually use?
> 
> If I do:
> 
> killall gpg-agent
> gpg-agent --daemon /bin/sh
> 
> The pinentry appears as it should and all is fine.

Yes, because using --daemon /bin/sh the environment is reset.

Stebe

> I also have:
> 
> GPG_TTY=$(tty)
> export GPG_TTY
> 
> set in ~/.bashrc as I saw that mentioned somewhere as well.
> 
> agent info:
> gpg-agent[14849]: gpg-agent (GnuPG) 2.1.15 started
> 
> gpg info:
> antony at 050415:~$ gpg2 --version
> gpg (GnuPG) 2.1.15
> libgcrypt 1.7.3
> Copyright (C) 2016 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later
> <https://gnu.org/licenses/gpl.html>
> This is free software: you are free to change and redistribute it.
> There is NO WARRANTY, to the extent permitted by law.
> 
> Home: /home/antony/.gnupg
> Supported algorithms:
> Pubkey: RSA, ELG, DSA, ECDH, ECDSA, EDDSA
> Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH,
>         CAMELLIA128, CAMELLIA192, CAMELLIA256
> Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224
> Compression: Uncompressed, ZIP, ZLIB, BZIP2
> 
> If anyone has any ideas, I'm all for them.
> 
> 
> 
> _______________________________________________
> Gnupg-users mailing list
> Gnupg-users at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-users
> 



More information about the Gnupg-users mailing list