Recovering GPG keys from a backup directory












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?










share|improve this question
















bumped to the homepage by Community 23 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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
















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?










share|improve this question
















bumped to the homepage by Community 23 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
















  • 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














1












1








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?










share|improve this question
















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?







gpg






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Dec 5 '13 at 22:58







Naftuli Kay

















asked Dec 5 '13 at 22:40









Naftuli KayNaftuli Kay

12.6k56162256




12.6k56162256





bumped to the homepage by Community 23 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.







bumped to the homepage by Community 23 mins ago


This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.















  • 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



















  • 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

















have you tried HOME=/mnt/home/naftuli/ gpg --list-keys?

– hildred
Dec 5 '13 at 22:54





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





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





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




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





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





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










2 Answers
2






active

oldest

votes


















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.






share|improve this answer































    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





    share|improve this answer























      Your Answer








      StackExchange.ready(function() {
      var channelOptions = {
      tags: "".split(" "),
      id: "106"
      };
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function() {
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled) {
      StackExchange.using("snippets", function() {
      createEditor();
      });
      }
      else {
      createEditor();
      }
      });

      function createEditor() {
      StackExchange.prepareEditor({
      heartbeatType: 'answer',
      autoActivateHeartbeat: false,
      convertImagesToLinks: false,
      noModals: true,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      imageUploader: {
      brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
      contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
      allowUrls: true
      },
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      });


      }
      });














      draft saved

      draft discarded


















      StackExchange.ready(
      function () {
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f103938%2frecovering-gpg-keys-from-a-backup-directory%23new-answer', 'question_page');
      }
      );

      Post as a guest















      Required, but never shown

























      2 Answers
      2






      active

      oldest

      votes








      2 Answers
      2






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes









      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.






      share|improve this answer




























        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.






        share|improve this answer


























          0












          0








          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Jul 25 '16 at 9:17









          Matthias ŠMatthias Š

          1




          1

























              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





              share|improve this answer




























                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





                share|improve this answer


























                  0












                  0








                  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





                  share|improve this answer













                  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






                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Oct 25 '16 at 22:43









                  mikejoneseymikejonesey

                  1,400415




                  1,400415






























                      draft saved

                      draft discarded




















































                      Thanks for contributing an answer to Unix & Linux Stack Exchange!


                      • Please be sure to answer the question. Provide details and share your research!

                      But avoid



                      • Asking for help, clarification, or responding to other answers.

                      • Making statements based on opinion; back them up with references or personal experience.


                      To learn more, see our tips on writing great answers.




                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function () {
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f103938%2frecovering-gpg-keys-from-a-backup-directory%23new-answer', 'question_page');
                      }
                      );

                      Post as a guest















                      Required, but never shown





















































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown

































                      Required, but never shown














                      Required, but never shown












                      Required, but never shown







                      Required, but never shown







                      Popular posts from this blog

                      Loup dans la culture

                      How to solve the problem of ntp “Unable to contact time server” from KDE?

                      ASUS Zenbook UX433/UX333 — Configure Touchpad-embedded numpad on Linux