1

I created a key-pair with Kleopatra, and using it everything looks ok; but when I use command line and try to list this key, I get a message:

sudo gpg --list-keys D87072B6
gpg: error reading key: public key not found

same happens if I try to list this key secret key:

sudo gpg --list-secret-keys D87072B6
gpg: error reading key: secret key not available’

I am missing something here; I just followed the instruction found on ‘https://wiki.debian.org/Subkeys’ to create new subkeys (quote):

"Create a new subkey for signing. Find your key ID: gpg –list-keys yourname"

I tried export a certificate of that key, and re-importing it, always with Kleopatra, to no avail.

Also, when I list keys with no specific name, it display the keys I have imported from the web; but not the keys belonging to me, that I have created on this computer; so I guess there’s something I am doing wrongly, but can’t guess what.

Can anyone point me to what is wrong?

Gpg –version says gpg (GnuPG) 1.4.20

1 Answer 1

1

If you run gpg with sudo, you are in effect running gpg as the root user. Thus you are trying to find the keys associated with the root user's gpg keyring, located in /root/.gnupg.

I am guessing you want to list the keys in your keyring, in /home/(username)/.gnupg. To that end, what happens if you run

gpg --list-keys

You should see all the keys in your keyring. And your own key should be there.

This assumes that Kleopatra is setup in such a way that it places the public-private key-pair you created in the ~/.gnupg directory.

PS - If you are going to use gpg on the command line, I recommend you install apt-get install gnupg2.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .