Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I have made a keypair for my email address using gnupg. I thought that I should probably keep a backup of it so that if I lose my desktop computer I can continue using the same key.

Is this the correct thinking?

How can I export my private key / the whole pair?

share|improve this question

1 Answer 1

Have you tried:

gpg --export-secret-key

That should do it. You might have to give the id of the key you want to export. And maybe also provide --armor if you want it in nice ASCII.

You don't need the public key because the public key can always be trivially generated from the private key.

Keeping a backup is likely a wise idea. I also tend to generate a revocation signature (the --gen-revoke option) that I don't publish and keep that backed up too, often in a separate place. This allows me to revoke the key if I lose it or it becomes compromised in some other way.

I strongly recommend you you keep the key backup offline.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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