4

I know that GnuPG is all about security, thus it's not giving many chance of retrieve private keys (otherwise anyone could do it) but I've got a private key, and my own rev.asc file.

I had to reinstall my Ubuntu box (former Ubuntu Studio) and I have backup of /home and /etc.

Is it possible to recover my GnuPG key instead of revoke it and create another one?

dag729
  • 241
  • 2
  • 6

1 Answers1

6

By default, GPG stores everything under the .gnupg directory in your home directory. (Your encrypted private key should be in ~/.gnupg/secring.gpg).

Restoring the entire ~/.gnupg directory from your backup will do the trick.

tante
  • 6,340
  • 1
  • 28
  • 23
Wim Coenen
  • 1,263
  • 1
  • 9
  • 13
  • Thanks! Sadly, something must have gone wrong, because I cannot find my ~/.gnupg directory in the backup...probably I lost it before (or during) the disaster that lead me to the reinstall. – dag729 Oct 21 '10 at 12:24
  • @dag729: just in case you don't know this - `ls` will consider files and folders starting with a dot to be invisible. Use `ls -a` to show everything in the backup of your home directory. – Wim Coenen Oct 21 '10 at 12:28