7

Possible Duplicate:
How to share one pgp-key on multiple machines?

I am about to upgrade my computer to 11.04. But before I do I want to backup my PGP key that I use for signing my ubuntu .deb packages. So that if something goes wrong in the upgrade I don't lose it.

How to I go about backing up my pgp key?

  • Although the answer to question marked as duplicate could well be used to answer this question, they are fundamentally different questions. I want to securely backup my PGP key is completely different from I want to use my PGP key on multiple computers. Because I have no intention of using my PGP on multiple computers I just want to back it up so it won't get lost. – trampster Aug 18 '11 at 2:24
  • If someone asked whats 4 + 5 and someone else asked whats 8 + 1. Would you say these are duplicate questions? Yes the answer to both is the same, but the question is different. IE the answers are duplicate but he questions most definitely are not duplicate. – trampster Aug 24 '11 at 4:52
8

From Ubuntu's GPG Howto:

Backing up your public key

  1. List your public keys:

    gpg --list-keys
    
  2. Look for the line that starts something like "pub 1024D/". The part after the 1024D is the key-id. To export the key:

    gpg -ao _something_-public.key --export key-id
    

Backing up your private key

  1. List your private keys:

    gpg --list-secret-keys
    
  2. Look for the line that starts something like "sec 1024D/". The part after the 1024D is the key-id. To export the private key:

    gpg -ao _something_-private.key --export-secret-keys key-id
    

How to restore is also listed there.

  • well if you see my question here askubuntu.com/questions/1249433/… I tried to create keys with your method there was no some thing 1024D format key id instead the key is very very long. So may be some thing has changed,however when i used the instructions here askubuntu.com/a/100313/992730 it gave me a key in your format.Meaning last few alphabets of long string were my keys as you mention in 1024D format.However when I get emails from launchpad or other forum related task the key is actually very very long string. – political science Jun 12 '20 at 21:22

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