Without any !: $ gpg -delete-secret-keys 8395C88AD6549DEE Here are my attempts to delete just the subkey. I generated new keys and tried using the subkey ID as you suggested: $ gpg -list-secret-keys The key gpg wanted to delete still didn't match the key I specified. When I placed the ! after the subkey's fingerprint, gpg gave me this output: $ gpg -delete-secret-keys 5B139477AE36C2F5D03C29E6920FD2FB0019253E! Gpg: key 0x8A1C31D584422F7A marked as ultimately trusted $ gpg -batch -passphrase '' -quick-generate-key 'test key' rsa4096 cert 0 Unfortunately, this doesn't seem to work. The secret subkey would have been listed as ssb# if it had been truly deleted. $ gpg -edit-key 8CD9B759DBA3DC2EBEAA31B40D72EEEAA1274AE5ĭo you really want to delete this key? (y/N) y Here are the steps to reproduce this behavior: $ gpg -with-keygrip -K 8CD9B759DBA3DC2EBEAA31B40D72EEEAA1274AE5 Peter Lebbing wrote a detailed explanation about this. If you export the public key, delkey the subkey and then import the public key back again, the secret subkey will come back. What actually happens is gpg deletes the public subkey packets and then stops listing the secret subkey since there is no public counterpart to it in the key pair. Turns out delkey does not delete the secret key.
![delete gpg mail mac delete gpg mail mac](https://sitesmedia.s3.amazonaws.com/computingservices/files/2013/05/1.png)
What is the correct way to do this? Did I understand it wrong? I specified the subkey by fingerprint but gpg interpreted the command as if I had specified my primary key instead. I tried using batch mode as well: $ gpg -batch -yes -delete-secret-keys 9CAE802DA78E4624BD8F88FE20AA2F4F7A28CD01 (as controlled by gpg-agent) is only used for the given OpenPGP public key. This extra pre-caution is done because gpg can’t be sure that the secret key
![delete gpg mail mac delete gpg mail mac](https://cerb.ai/assets/images/guides/mail/gpg/key-server-io-public-key-server.png)
The option -yes can be used to advice gpg-agent not to request a confirmation. In batch mode the key must be specified by fingerprint.
![delete gpg mail mac delete gpg mail mac](https://cdn.osxdaily.com/wp-content/uploads/2018/12/howto-delete-email-address-suggestion-mail-mac-2-610x346.jpg)
$ gpg -delete-secret-keys 9CAE802DA78E4624BD8F88FE20AA2F4F7A28CD01Įven though I specified the subkey by fingerprint, gpg asks me to confirm the deletion of the primary key. Gpg: key 0xA52099E0E7EB77A5 marked as ultimately trusted I was able to reproduce my mistake: $ gpg -batch -passphrase '' -quick-generate-key 'test key' rsa4096 cert 0 I tried to use gpg -delete-secret-keys to delete some revoked subkeys but ended up accidentally deleting my primary key instead.