Mailing List Archive

GPG agent returns subset of keys for SSH
Hi,

I want to use gpg-agent to authenticate to an SSH server via key. This
has previously worked on this machine when I was using a Nitrokey, now I
imported the key that was on the Nitrokey locally from a backup, and SSH
authentication no longer works.

ssh -vvvv server lists these interesting messages:

debug3: ssh_get_authentication_socket_path: path
'/run/user/1000/gnupg/S.gpg-agent.ssh'
debug2: get_agent_identities: ssh_agent_bind_hostkey: agent refused
operation
debug1: get_agent_identities: ssh_fetch_identitylist: agent contains no
identities

However, gpg --list-secret-keys shows this:

sec   rsa4096 2020-04-07 [SC]
      94B238AAE6682E5063896F2B7920D03B7AA7CD7B
uid           [ultimate] Lu Ro (New general key) <public@lrose.de>
ssb   rsa4096 2020-04-07 [E]
ssb   rsa4096 2020-04-07 [A]

So the authenticate subkey is indeed present.

I executed ssh-add without arguments, and two keys were added from my
.ssh directory. Now ssh -vvvv shows this:

debug3: ssh_get_authentication_socket_path: path
'/run/user/1000/gnupg/S.gpg-agent.ssh'
debug2: get_agent_identities: ssh_agent_bind_hostkey: agent refused
operation
debug1: get_agent_identities: agent returned 2 keys

So communication with the gpg-agent seems to work as well. Any ideas
what could be the issue?

Thanks in advance,

lukaro


_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: GPG agent returns subset of keys for SSH [ In reply to ]
On Tue, 16 May 2023 01:19, LuKaRo said:

> '/run/user/1000/gnupg/S.gpg-agent.ssh'
> debug2: get_agent_identities: ssh_agent_bind_hostkey: agent refused
> operation

You should log the other side of the things: Put

log-file /whatever/you/want
verbose
debug ipc

into ~/.gnupg/gpg-agent.conf and "gpgconf --kill gpg-agent". If you
are not yet running 2.4 (or the older 2.3) you should definitely do so.


Salam-Shalom,

Werner

--
The pioneers of a warless world are the youth that
refuse military service. - A. Einstein