How to transfer GPG key to another computer

7 Antworten [Letzter Beitrag]
ssdclickofdeath
Offline
Beigetreten: 05/18/2013

I would like to copy my GPG key from my desktop computer to my laptop computer. How is this done?

jxself
Offline
Beigetreten: 09/13/2010

Look into GPG's import and export functions.

So, on the old computer (replacing FFFFFFFF as appropriate):

gpg --export -a FFFFFFFF > public.asc
gpg --export-secret-keys -a FFFFFFFF > secret.asc

On the new computer:

gpg --import public.asc
gpg --import secret.asc
gpg --edit-key FFFFFFFF (and set the trust level and whatever else.)

ADFENO
Offline
Beigetreten: 12/31/2012

Note: This post only shows how to export private keys, which in your case, is done on the old computer.

Export your OpenPGP private key through Seahorse

1. Right click on your own key.

2. Click on Properties.

3. Click on the Details tab.

4. Click on the icon near Export full key.

5. Choose a name and a location for the file which will hold the key.

Export your OpenPGP private key through GnuPG

gpg --export-secret-keys --armor --output "[Name here].asc"

Or:

gpg --export-secret-keys -a -o "[Name here].asc"

Best regards, ADFENO.
Have a nice day.

Addendum: You can check if it really is your private key just by opening the exported file with your preferred plain text editor, it must begin with "-----BEGIN PGP PRIVATE KEY BLOCK-----".

Andresm

I am a member!

Offline
Beigetreten: 11/21/2010

thank you for this!

i guess the same applies for putting it on your phone using k-9?

Andresm

I am a member!

Offline
Beigetreten: 11/21/2010

For completeness sake,
What if you have your keys in a separtate /home partition and you have to reinstall trisquel?

Will seahorse be OK with using the settings in .gpg?

ADFENO
Offline
Beigetreten: 12/31/2012

Now that's a good question.

I can't tell you for sure because I never did it, but perhaps you just have to copy the keyrings and the trust databases from the .gnupg folder, I mean, considering that you don't need your GnuPG custom configurations (if to does exist).

Best regards, ADFENO.
Have a nice day.

Darksoul71
Offline
Beigetreten: 01/04/2012

Beside all this import / export mumbo jumbo one can simply zip up ~/.gnupg, transfer it to the other system via a safe channel and unzip the file to ~/.gnupg

I just did so some weeks ago and everything works like a charm. Even Thunderbird with Enigmail.

HTH,
Holger