I have a GPG key which I use to sign and submit packages to Launchpad.
Is it possible to reuse that key in another installation, or do I always have to create a new key for the new installation of a GNU/Linux operating system?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Rather than copying the
~/.gnupg folder, you can create an export of your secret keys and then import on the new install, e.g.
$ gpg --export-secret-keys --output mykeys
Then on the new system:
$ gpg --import mykeys
(note: you will need to know the password associated with the keys to import them)
By exporting and importing, you allow
gpg to handle any version/format differences between differing versions of
gpg on the different installs.
You can use the
--export option for your stored public keys in the same manner. (though I have found not including the public keys as a good way to purge all the old, non-used keys that have been collected over the years if you don't explicitly need them)