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

gpg-ssh signing with AgentForwarding

From
YBYarden Bar <ayash.jorden@gmail.com>
Date
Nov 7, 2024, 04:16 UTC
Message-ID
<CAJPGt+U1icoNJHPtiFcidtwN6ts03jH9WpaGxDGoE5RBQSCCLA@mail.gmail.com>

Hello Git community, Not sure what search terms I haven't used, but I'll try to describe the use-case

On my local machine I have a SSH key, and I use AgentForwarding when I go out and about to other hosts (dev machines) The usual workflow of using the forwarded socket works for pull and push.

Where it gets pitch-dark is when I try to use my ssh key to sign git commits.
Following is my git config on the remote host:
=====================
[user]
    name = John Doe
    email = jdoe@jdoe.com
# on my local machine(gpg-ssh signing works): signingkey =
/Users/jdoe/.ssh/id_ecdsa.pub
    signingkey = WHAT_SHOULD_I_PUT_HERE # on my laptop its the path to
the public key from Secretive, or just omit it?
[gpg]
    format = ssh
[commit]
    gpgsign = true
[gpg "ssh"]
    allowedSignersFile = /Users/jdoe/.gpg.ssh.allowedSignersFile #
contents is: "email1,email2 key-type public_key comment"
=====================
I've tried
1. `ssh-agent -a /path/to/ssh.sock` - errored with address already in use
2. signingkey set to a path on the remote host with my public key,
errored with "no private key found"

I sense that I should be able to employ `gpg.ssh.defaultKeyCommand` to use the socket somehow, but I can't wrap my head around it or find some docs/guidance.

Other (related) links
https://developer.1password.com/docs/ssh/git-commit-signing/ - I think
that 1Password invested the time to make it work
https://github.com/maxgoedjen/secretive/discussions/338#discussioncomment-11170722
- asked the same on Secretive repo, which is one way to store keys
https://github.com/maxgoedjen/secretive/issues/405#issuecomment-2460948732
- also here.

Thank you, Jordan

Next: Fabian Stelzer
Message 1 of 4 in “gpg-ssh signing with AgentForwarding”
  1. Yarden BarNov 7, 2024
  2. Fabian StelzerNov 7, 2024
  3. brian m. carlsonNov 7, 2024
  4. Yarden BarNov 14, 2024

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.