Mailing List Archive

Failed to use GPG key for SSH
I've followed the guide at
https://opensource.com/article/19/4/gpg-subkeys-ssh before, with
success. But lately, I haven't been able to use SSH.

I'll try to provide enough info below.

OS: Fedora Silverblue 38

[caleb@farnsworth ~]$ gpg --list-secret-keys
/var/home/caleb/.gnupg/pubring.kbx
----------------------------------
sec# rsa3072 2023-06-29 [SC]
631CC434A56B5CBDFF21234697643795FA3E4BCE
uid [ultimate] Caleb Herbert <csh@bluehome.net>
ssb# rsa3072 2023-06-29 [E]
ssb# rsa2048 2023-06-29 [A]

[caleb@farnsworth ~]$ ls -la ~/.gnupg/
total 76
drwx------. 1 caleb caleb 230 Jul 11 21:59 .
drwx------. 1 caleb caleb 378 Jul 11 19:55 ..
drw-------. 1 caleb caleb 14 Jul 9 02:26 crls.d
-rw-------. 1 caleb caleb 19 Jul 8 22:00 gpg-agent.conf
drw-------. 1 caleb caleb 88 Jul 8 22:00 openpgp-revocs.d
drw-------. 1 caleb caleb 264 Jul 8 22:00 private-keys-v1.d
-rw-------. 1 caleb caleb 6498 Jul 9 00:37 pubring.kbx
-rw-------. 1 caleb caleb 2718 Jul 8 22:00 pubring.kbx~
-rw-------. 1 caleb caleb 600 Jul 11 19:46 random_seed
-rw-------. 1 caleb caleb 758 Jul 11 21:59 sshcontrol
-rw-------. 1 caleb caleb 49152 Jul 8 22:00 tofu.db
-rw-------. 1 caleb caleb 1280 Jul 8 22:00 trustdb.gpg

[caleb@farnsworth ~]$ cat .gnupg/gpg-agent.conf
enable-ssh-support

[caleb@farnsworth ~]$ tail .bashrc
if [ -f "$rc" ]; then
. "$rc"
fi
done
fi

unset rc

export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-ssh-socket)
gpgconf --launch gpg-agent

[caleb@farnsworth ~]$ export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-
ssh-socket)
[caleb@farnsworth ~]$ gpgconf --launch gpg-agent
[caleb@farnsworth ~]$ ssh-add -L
The agent has no identities.

--
Caleb Herbert
https://bluehome.net/csh/


_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Failed to use GPG key for SSH [ In reply to ]
On 12.07.23 05:28, Caleb Herbert wrote:
> [caleb@farnsworth ~]$ export SSH_AUTH_SOCK=$(gpgconf --list-dirs agent-
> ssh-socket)
> [caleb@farnsworth ~]$ gpgconf --launch gpg-agent
> [caleb@farnsworth ~]$ ssh-add -L
> The agent has no identities.
>


Hi Caleb,
But you have the correct keygrip in `~/.gnupg/sshcontrol`?

(Don't nail me on details, but my impression was, that /sometimes/ a
kill on the gpg-agent is necessary, however `gpgconf --reload` should be
enough.)

_______________________________________________
Gnupg-users mailing list
Gnupg-users@gnupg.org
https://lists.gnupg.org/mailman/listinfo/gnupg-users
Re: Failed to use GPG key for SSH [ In reply to ]
* 2023-07-11 22:28:36-0500, Caleb Herbert wrote:

> But lately, I haven't been able to use SSH.

> sec# rsa3072 2023-06-29 [SC]
> 631CC434A56B5CBDFF21234697643795FA3E4BCE
> uid [ultimate] Caleb Herbert <csh@bluehome.net>
> ssb# rsa3072 2023-06-29 [E]
> ssb# rsa2048 2023-06-29 [A]

Secret keys are missing from this keyring, tells the "#" mark. Text
"sec#" means that the primary secret key is missing and "ssb#" tells the
same about secret subkeys. Those should read as "sec" and "ssb", without
the "#" mark, or "sec>" or "ssb>" if the key data is actually on a smart
card.

--
/// Teemu Likonen - .-.. https://www.iki.fi/tlikonen/
// OpenPGP: 6965F03973F0D4CA22B9410F0F2CAE0E07608462
Re: Failed to use GPG key for SSH [ In reply to ]
On Wed, 2023-07-12 at 13:55 +0300, Teemu Likonen wrote:
> Secret keys are missing from this keyring, tells the "#" mark. Text
> "sec#" means that the primary secret key is missing and "ssb#" tells
> the
> same about secret subkeys. Those should read as "sec" and "ssb",
> without
> the "#" mark, or "sec>" or "ssb>" if the key data is actually on a
> smart
> card.
>

That doesn't sound good. But I can decrypt and encrypt mail, and
connect to SSH, now that I've restarted gpg-agent.

--
Caleb Herbert
https://bluehome.net/csh/