1

I have a backup image mounted at /mnt. I need to recover (and revoke) a key in the secret keyring on this backup.

How can I list keys and generate a revocation key for a key stored in this other keyring?

When I do:

gpg --homedir /mnt/home/naftuli/.gnupg --list-keys

I see the keys installed locally and not the keys installed in the backup's keyring.

What's really strange is that if I chroot to the /mnt folder and run gpg --list-keys, I still see the keys in the other keyring.

Any ideas?

  • have you tried HOME=/mnt/home/naftuli/ gpg --list-keys? – hildred Dec 5 '13 at 22:54
  • Same thing. It shows the results from the other keyring. One of the keys was just generated today, and the backup is from 2013/11/29, so the new key really shouldn't be in that backup. – Naftuli Kay Dec 5 '13 at 22:56
  • do you have any absolute paths in /mnt/home/naftuli/.gnupg/gpg.conf? what does ls -lnd /mnt/home/naftuli/ /home/naftuli/ say? – hildred Dec 5 '13 at 23:00
  • 3
    You probably have gpg-agent running, and are listing keys in the agent. Try --no-use-agent – derobert Dec 5 '13 at 23:06
  • Looks like something weird was going on, the mounted directory was a loop for some reason to /. No idea why, but working around it. – Naftuli Kay Dec 5 '13 at 23:08
0

If chrooting, killing the agent, etc. don't work for you, swap the gpg folders, and reboot.

If you still see your new keys, something isn't right in your setup, or the folder paths are not what you think they are.

0

no need to chroot, I often generate wot maps / diagrams from a separate gpg db than my main, (for example a work team). to do this export GNUPGHOME

export GNUPGHOME=/mnt/home/naftuli
cd $GNUGPHOME
gpg --list-keys

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.