Because of an accidental formatting I've lost two private keys(no backup). I've generated a new one but I want to remove the lost ones from the keyserver.
TL;DR: There is no way, you're out of luck.
OpenPGP key servers do not allow removal of keys for various reasons, mostly it boils down to
- having the OpenPGP web of trust being resilient against deletion attacks,
- missing procedures to do so,
- technical reasons with the key servers exchanging keys with each other ("gossiping") and
- the fact key servers are operated by hundreds of individuals all over the world (also in pretty much all countries of the world, if you'd like to go through the legal route).
If you'd ask the individual operators to remove a key, they might block it on their own server (but the others will still be hosting it), or simply tell you they won't do so because of the reasons given above.
For further reading, I'd recommend How long do keys stay on keyservers? for a more detailed discussion why deleting keys would be a bad thing to have.
The "OpenPGP way" to remove old keys is to mark them as revoked by uploading special revocation certificates. These will tell other OpenPGP users that your key is superseded.
Revoking keys is not possible if you don't have access to the private key, defined a designated revoker or a pregenerated revocation certificate.
If you don't have a revocation certificate for your new key yet, generate one now!
Comments are hardly possible, either:
- people would not realize they're there if using some OpenPGP client software
- anybody could've uploaded them, as you can't sign them with your private key
- there is no such thing as comments anyway.
To prevent loosing access to your key, do following:
- Regularly backup your computer (important anyway).
- Create an offline copy of your private keys.
- Create a revocation certificate immediately after creating a primary key. Store it both in a digital way and print it on a piece of paper (I recommend something like
gpg --gen-revoke | qrencodeto be able to scan the certificate without the hassles of OCR).
- Create a second copy and hand it to somebody you trust. He cannot do anything but revoke your keys with it (never gain access!), but you always have a fall-back in worst case scenarios (house burned, robbery, ...).
I am afraid that this is not possible. As pgp keys are synchronized also with other servers, it would also not be effective. Other keyservers would still have your key.
The following will not be very helpful for you, but it may help other readers:
If you had the private key, you could have used gpg to generate a revocation certificate, and upload that to the keyserver. This would not delete your key from the key server, but it would tell people who download it that the key has been revoked, and should not be used. More information on this can be found here.
For future readers of this question.
Of course you can delete keys from a keyserver since they aren't physically engraved onto a indestructable stone.
Jokes aside I also wanted to have a key removed from ubuntu keyservers and I submitted a data privacy enquiry on their website. https://ubuntu.com/legal/data-privacy/enquiry
I also signed this message with the key that I wanted to have removed. You probably can also provide a photo of an ID to have a key with your personal data removed.
A couple of days later I got an email from ubuntu that they received my request according to GDPR article xyz followed by another email a few hours later that they have removed my key.
Your private key is not on any keyserver unless you have done something Very Wrong. The only key that should be on the keyserver is your PUBLIC key.
So, you cannot retrieve your private key from a keyserver in any case.
If you have only "formatted" your disk (and not done security wipe or physical destruction), then you may be able to recover the private key using file recovery or forensic techniques. These methods will depend on the disk format, operating system and other factors.