Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am using gpg and generated, imported and signed keys.

How can I take all of the work that I have done and export all of my keys then import them into another machine?

share|improve this question

migrated from Oct 13 '09 at 15:53

This question came from our site for professional and enthusiast programmers.

up vote 5 down vote accepted


  gpg --export my_key -o my_public_key.gpg
  gpg --export-secret-key my_key -o my_secret_key.gpg


  gpg --import my_public_key.gpg
  gpg --allow-secret-key-import --import my_secret_key.gpg
share|improve this answer
I am going to try this sometime this week! Thanks satanicpuppy! – Daniel Oct 19 '09 at 22:05
The options used: -o, --output use as output file – Daniel Oct 28 '09 at 23:28

Traditional PGP let you just copy the keyring files around, or just merge them by invoking it on the keyring to import. I've not kept up with GPG, but I'd be surprised if it differed significantly.

Actually, if you were being properly paranoid, the private keyring should live on a thumbdrive or similar removable device, with perhaps a securely stored CD-R or similar for backup), so that part would be moot.

share|improve this answer

You can just copy pubring.gpg, secring.gpg and trust.db from the old machine to the new one.

  • secring.gpg contains all your private keys
  • pubring.gpg contains all your public keys (imported, signed keys)
  • trust.db contains yout user trust settings (if used)

HTH, Jan

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .