Accidentally deleted ~/.gnupg/pubring.gpg

renws renws at protonmail.com
Sun Aug 16 06:33:22 CEST 2020


Hi Veddal,


Thanks for your reply. Sorry I meant to reply to an answer of my original post https://lists.gnupg.org/pipermail/gnupg-users/2020-July/063772.html, but I'm a little confused how mailing list work so I might have created a new thread with the same title.

Basically, I've accidentally deleted ~/.gnupg/pubring.gpg and now I'm not able to see any output from `gpg --list-keys' and `gpg --list-secret-keys'.

And I don't have any backup of my public key, so I would like to know whether it's possible to decrypt my files (I've still got ~/.gnupg/private-keys-v1.d, which I think stores my private key?).

Tried your suggestions but didn't work for:

➜  .gnupg gpg /home/rws/.gnupg/secring.gpg
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: DBG: FIXME: merging secret key blocks is not anymore available
gpg: DBG: FIXME: No way to print secret key packets here
➜  .gnupg gpg 6906A68A85C4AEAC
gpg: WARNING: no command supplied.  Trying to guess what you mean ...
gpg: can't open '6906A68A85C4AEAC'





Regards,
Wenshan



‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Tuesday, August 11, 2020 7:50 AM, <vedaal at nym.hush.com> wrote:

> On 8/8/2020 at 3:13 PM, "renws via Gnupg-users"gnupg-users at gnupg.org wrote:
>
> > Hi,
> > I tried --try-all-secrets but it didn't work:
> > $ gpg -d --try-all-secrets myfile.txt.gpg
> > gpg: encrypted with RSA key, ID xxxxxxxxxxxxx
> > gpg: decryption failed: No secret key
> > I guess I'll have to create a new public key with the same
> > fingerprint? I've searched "gpg create public key with same
> > fingerprint" but didn't get much luck. Could you please provide
> > more detailed how-to instructions?
>
> ==
>
> It's not clear what you did and what the problem is. Please explain more.
>
> The Subject is "Accidentally deleted ~/.gnupg/pubring.gpg"
>
> This is not so terrible, as the Secret Keys automatically contain the public keys, and they can be regenerated from them.
>
> Try this:
>
> gpg secring.gpg
> (you need to put in the exact path of where the secring.gpg is located, before the secring.gpg)
>
> GnuPG will list all the secret keys. It might detect the absence of a pubring.gpg and automatically create one, but I have not tried it, and do not have a test system here to try it.
>
> But
> I (have successfully) tried to restore a public key just by the command
> gpg keyname of the secret key.
>
> vedaal





More information about the Gnupg-users mailing list