How to export your PGP private Key to another computer

First of all: Do you have some private keys in your machine?

Try this:

gpg --list-secret-keys

In my case:

/Users/moncho/.gnupg/secring.gpg
--------------------------------
sec   2048R/87273203 2015-05-21
uid                  Moncho 
ssb   2048R/8C042203 2015-05-21

Now you only need write this command:

gpg --armor --export-secret-keys moncho@penarodriguez.org > warning_my_private_key.txt

Be careful with your private key!

Now send to another computer the key and import:

gpg --allow-secret-key-import --import warning_my_private_key.txt

Do the same with public key, first export:

gpg --armor --export moncho@penarodriguez.org > my_public_key.txt

And import:

gpg --import my_public_key.txt

More information in GnuPG.

Published on in Systems