4

I'm trying to use keychain(1) with my GnuPG key on Debian Testing. However, I get the following message with this command:

$ keychain --agents gpg MYPGPKEY

 * keychain 2.8.2 ~ http://www.funtoo.org
 * Starting gpg-agent...
 * Warning: can't find MYPGPKEY; skipping

where MYPGPKEY is my actual key.

I can check that such key exits with the following command:

$ gpg --list-keys MYPGPKEY >/dev/null 2>&1 && echo "key exists"
key exists

How can I add my gpg key with keychain?

Petr Razumov
  • 1,952
  • 2
  • 17
  • 32

3 Answers3

2

It looks like an output parsing incompatibility between keychain 2.8.2 and gpg 2.2.4, the two versions used in Ubuntu 18.04

I added the following to my ~/.gnupg/gpg.conf, which fixed the issue:

keyid-format LONG

Source: https://github.com/funtoo/keychain/issues/107

Prashanth Chandra
  • 2,672
  • 3
  • 24
  • 42
1

I believe the problem may be associated with your gpg and keychain version possible incompatibility. I can see that you are using 2.8.2 version which displays this error message that 2.7.0 doesn't. Stable version of Debian is using gnupg 1.4.18-7+deb8u3enter code here and Testing is using 2.1.18-6, which differ a lot. Are you using your private key ID or your subkey ID? My suggestion is changing the key ID provided to keychain

Reference

Kudlaty 01
  • 21
  • 2
1

Specifying keyid-format LONG in ~/.gnupg/gpg.conf didn't work for me, but (per https://github.com/funtoo/keychain/issues/107#issuecomment-806252699) specifying --agents "gpg,ssh" in keychain's arguments (in my case, keychain --eval --agents "gpg,ssh" id_rsa id_ed25519 DEADBEEF) did the trick.

YellowApple
  • 901
  • 8
  • 13