git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Commit signing and pinentry problems

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
Nov 21, 2019, 00:48 UTC
Message-ID
<20191121004831.GB6430@camp.crustytoothpaste.net>
In-Reply-To
<CAH8yC8n+ta4BSAE4rEfhKxe3T9poVdc94HvSk=6PEA4YbmwVyA@mail.gmail.com>
On 2019-11-20 at 12:41:23, Jeffrey Walton wrote:
Show 22 quoted lines
> Hi Everyone,
> 
> I'm having an annoying problem that I can't figure out. I hope Git has
> a setting to fix it.
> 
> I have a desktop workstation where I sit at the keyboard about 1/3 of
> the time. Git signing works as expected. About 2/3 of the time I SSH
> into the machine. Git signing does not work when SSH'd in.
> 
> When Git signing fails over SSH an error looks like:
> 
>    $ git commit -S log.h -m "Remove unneeded header"
>    error: gpg failed to sign the data
>    fatal: failed to write commit object
> 
> I just noticed this today (but it makes sense)...
> 
>     - Go to desktop workstation, log in
>     - Go to remote machine, log in
>     - Sign at remote machine over SSH
>       - Desktop workstation will open GUI password prompt
>       - Remote machine sign operation will hang until GUI prompt times-out

This isn't really a Git problem, so much as a GnuPG one. You probably want to use the curses pinentry input instead of the GUI one. If you're using Ubuntu, you can set "pinentry-program /usr/bin/pinentry-curses" in ~/.gnupg/gpg-agent.conf, kill all of the gpg-agent processes, and then attempt to sign again.

You may also need to set GPG_TTY and/or kill the gpg-agent process when logging in remotely. See gpg-agent(1) for details on configuration and use.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204
Previous: Randall S. BeckerNext: Jeffrey Walton
Message 3 of 4 in “Commit signing and pinentry problems”
  1. Jeffrey WaltonNov 20, 2019
  2. Randall S. BeckerNov 20, 2019
  3. brian m. carlsonNov 21, 2019
  4. Jeffrey WaltonMar 2, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.