* Commit signing with SSH key uses SSH_AUTH_SOCK but ignores IdentityAgent
@ 2024-09-13 9:58 Justin Su
2024-09-13 15:05 ` Phillip Wood
0 siblings, 1 reply; 3+ messages in thread
From: Justin Su @ 2024-09-13 9:58 UTC (permalink / raw)
To: git
I use Secretive (https://github.com/maxgoedjen/secretive) to store my
SSH keys on macOS. I've configured my ssh_config to use it as the
IdentityAgent, and Git can push and pull just fine.
However, it seems that Git ignores IdentityAgent when signing commits,
resulting in the following error message:
error: No private key found for public key "foo.pub"?
fatal: failed to write commit object
I've worked around this by setting SSH_AUTH_SOCK, but this doesn't
feel correct to me. Is this intended behaviour?
Thanks,
Justin
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Commit signing with SSH key uses SSH_AUTH_SOCK but ignores IdentityAgent
2024-09-13 9:58 Commit signing with SSH key uses SSH_AUTH_SOCK but ignores IdentityAgent Justin Su
@ 2024-09-13 15:05 ` Phillip Wood
2024-09-14 16:08 ` Justin Su
0 siblings, 1 reply; 3+ messages in thread
From: Phillip Wood @ 2024-09-13 15:05 UTC (permalink / raw)
To: Justin Su, git
Hi Justin
On 13/09/2024 10:58, Justin Su wrote:
> I use Secretive (https://github.com/maxgoedjen/secretive) to store my
> SSH keys on macOS. I've configured my ssh_config to use it as the
> IdentityAgent, and Git can push and pull just fine.
>
> However, it seems that Git ignores IdentityAgent when signing commits,
> resulting in the following error message:
Git just runs "ssh -Y". I can reproduce this on linux - I suspect the
problem is that ssh does not read the IdentityAgent config when signing
even if it is outside a Host/Match in the config file.
Best Wishes
Phillip
> error: No private key found for public key "foo.pub"?
> fatal: failed to write commit object
>
> I've worked around this by setting SSH_AUTH_SOCK, but this doesn't
> feel correct to me. Is this intended behaviour?
>
> Thanks,
> Justin
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Commit signing with SSH key uses SSH_AUTH_SOCK but ignores IdentityAgent
2024-09-13 15:05 ` Phillip Wood
@ 2024-09-14 16:08 ` Justin Su
0 siblings, 0 replies; 3+ messages in thread
From: Justin Su @ 2024-09-14 16:08 UTC (permalink / raw)
To: phillip.wood; +Cc: git
On Fri, Sep 13, 2024 at 11:05 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
>
> Hi Justin
>
> On 13/09/2024 10:58, Justin Su wrote:
> > I use Secretive (https://github.com/maxgoedjen/secretive) to store my
> > SSH keys on macOS. I've configured my ssh_config to use it as the
> > IdentityAgent, and Git can push and pull just fine.
> >
> > However, it seems that Git ignores IdentityAgent when signing commits,
> > resulting in the following error message:
>
> Git just runs "ssh -Y". I can reproduce this on linux - I suspect the
> problem is that ssh does not read the IdentityAgent config when signing
> even if it is outside a Host/Match in the config file.
Agreed, this seems like a ssh-keygen limitation. I reproduced this
directly with ssh-keygen on macOS.
According to its man page, if you pass a public key for the `-f`
option, then the private half needs to be available via ssh-agent. The
man page doesn't mention SSH_AUTH_SOCK either, but I guess it's the
best solution for my use case.
> Best Wishes
>
> Phillip
>
> > error: No private key found for public key "foo.pub"?
> > fatal: failed to write commit object
> >
> > I've worked around this by setting SSH_AUTH_SOCK, but this doesn't
> > feel correct to me. Is this intended behaviour?
> >
> > Thanks,
> > Justin
> >
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-09-14 16:09 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-09-13 9:58 Commit signing with SSH key uses SSH_AUTH_SOCK but ignores IdentityAgent Justin Su
2024-09-13 15:05 ` Phillip Wood
2024-09-14 16:08 ` Justin Su
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).