<div dir="ltr">Looks like you've hit the nail on the head there.<div><br></div><div><pre><font color="#EEE8D5"><b>$ </b></font>dpkg -l 'pinentry*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name           Version      Architecture Description
+++-==============-============-============-=================================
un  pinentry       <none>       <none>       (no description available)
un  pinentry-curse <none>       <none>       (no description available)
un  pinentry-doc   <none>       <none>       (no description available)
ii  pinentry-gnome 0.9.7-6      amd64        GNOME 3 PIN or pass-phrase entry 
ii  pinentry-gtk2  0.9.7-6      amd64        GTK+-2-based PIN or pass-phrase e
un  pinentry-x11   <none>       <none>       (no description available)

<font color="#B58900"><b>csmall</b></font><font color="#EEE8D5"><b>@</b></font><font color="#D30102"><b>elmo</b></font><font color="#EEE8D5"><b>: </b></font><font color="#859900"><b>~</b></font>
<font color="#EEE8D5"><b>$ </b></font>readlink -f $(which pinentry)
/usr/bin/pinentry-gnome3
</pre></div><div><br></div><div>I also rebuilt the pinentry-gnome3 with the patch. What happens now is I get the ncurses pinentry screen appearing and the file is successfully signed. So yes, for me at least your patch solves my problem. Thanks for the quick answer!</div><div><br></div><div> - Craig</div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr">On Tue, Oct 25, 2016 at 4:57 AM Daniel Kahn Gillmor <<a href="mailto:dkg@fifthhorseman.net">dkg@fifthhorseman.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Control: tags 841909 + moreinfo<br class="gmail_msg">
Hi Craig--<br class="gmail_msg">
<br class="gmail_msg">
On Mon 2016-10-24 07:13:25 -0400, Craig Small wrote:<br class="gmail_msg">
> Since the latest upgrade, I am unable to sign anything using a ssh<br class="gmail_msg">
> shell.<br class="gmail_msg">
><br class="gmail_msg">
> $ gpg --sign gpg.txt<br class="gmail_msg">
> File 'gpg.txt.gpg' exists. Overwrite? (y/N) y<br class="gmail_msg">
> gpg: signing failed: Configuration error<br class="gmail_msg">
> gpg: signing failed: Configuration error<br class="gmail_msg">
><br class="gmail_msg">
> There is a work-around<br class="gmail_msg">
> ssh to the remote system<br class="gmail_msg">
> killall gpg-agent<br class="gmail_msg">
> unset DBUS_SESSION_BUS_ADDRESS<br class="gmail_msg">
> gpg will now work.<br class="gmail_msg">
><br class="gmail_msg">
> I am unsure why this environment variable causes the problem. It has<br class="gmail_msg">
> something to do with the gpg-agent not gpg itself.<br class="gmail_msg">
><br class="gmail_msg">
> I tried it with two ssh sessions, one running gpg and one running gpg<br class="gmail_msg">
> agent. If the agent had that variable unset, it worked even if the<br class="gmail_msg">
> window running gpg itself had it set. The other way around it failed<br class="gmail_msg">
> meaning gpg-agent and not gpg itself has the problem with the<br class="gmail_msg">
> environment.<br class="gmail_msg">
><br class="gmail_msg">
> This is gpg-agent with the environment vatiable set.<br class="gmail_msg">
><br class="gmail_msg">
> gpg-agent --verbose --homedir /home/csmall/.gnupg --use-standard-socket --daemon /bin/bash<br class="gmail_msg">
> gpg-agent[28745]: WARNING: "--use-standard-socket" is an obsolete option - it has no effect<br class="gmail_msg">
> gpg-agent[28745]: listening on socket '/run/user/1000/gnupg/S.gpg-agent'<br class="gmail_msg">
> gpg-agent[28745]: listening on socket '/run/user/1000/gnupg/S.gpg-agent.rstrd'<br class="gmail_msg">
> gpg-agent[28745]: listening on socket '/run/user/1000/gnupg/S.gpg-agent.brwsr'<br class="gmail_msg">
> gpg-agent[28745]: listening on socket '/run/user/1000/gnupg/S.gpg-agent.ssh'<br class="gmail_msg">
> gpg-agent[28746]: gpg-agent (GnuPG) 2.1.15 started<br class="gmail_msg">
> $ gpg-agent[28746]: handler 0x7f347273d700 for fd 8 started<br class="gmail_msg">
> gpg-agent[28746]: starting a new PIN Entry<br class="gmail_msg">
> gpg-agent[28746]: failed to unprotect the secret key: Configuration error<br class="gmail_msg">
> gpg-agent[28746]: failed to read the secret key<br class="gmail_msg">
> gpg-agent[28746]: command 'PKSIGN' failed: Configuration error <Pinentry><br class="gmail_msg">
> gpg-agent[28746]: handler 0x7f347273d700 for fd 8 terminated<br class="gmail_msg">
> gpg-agent[28746]: handler 0x7f3471f3c700 for fd 9 started<br class="gmail_msg">
> gpg-agent[28746]: handler 0x7f3471f3c700 for fd 9 terminated<br class="gmail_msg">
<br class="gmail_msg">
It sounds to me like what you're seeing is pinentry-gnome3, which knows<br class="gmail_msg">
to fall back to curses if DBUS_SESSION_BUS_ADDRESS is unset, but which<br class="gmail_msg">
fails when run with an active DBUS session but no way to prompt the<br class="gmail_msg">
user.<br class="gmail_msg">
<br class="gmail_msg">
I'd like to confirm this, though: what version(s) of pinentry do you<br class="gmail_msg">
have installed on the system in question?  what is the default pinentry?<br class="gmail_msg">
<br class="gmail_msg">
  dpkg -l 'pinentry-*'<br class="gmail_msg">
  readlink -f $(which pinentry)<br class="gmail_msg">
<br class="gmail_msg">
additionally, you could try adding debug-pinentry to the gpg-agent<br class="gmail_msg">
config, to see if there's any additional information provided.<br class="gmail_msg">
<br class="gmail_msg">
If my guess is correct and you're using pinentry-gnome3 but the system<br class="gmail_msg">
doesn't have gcr running or available, you might try the attached patch<br class="gmail_msg">
to pinentry-gnome3.  i proposed the it to upstream but there's been some<br class="gmail_msg">
pushback.  If you could confirm that it works for you in this context<br class="gmail_msg">
that'd be good to know.<br class="gmail_msg">
<br class="gmail_msg">
Alternately, try specifying pinentry-curses as your preferred pinentry<br class="gmail_msg">
on the remote machine, either via pinentry-program (in gpg-agent.conf)<br class="gmail_msg">
or via "update-alternatives --config pinentry", or by just purging all<br class="gmail_msg">
the graphical pinentries and leaving only pinentry-curses (if your<br class="gmail_msg">
machine never has a graphical environment available).<br class="gmail_msg">
<br class="gmail_msg">
let me know what you find!<br class="gmail_msg">
<br class="gmail_msg">
        --dkg<br class="gmail_msg">
<br class="gmail_msg">
</blockquote></div>