知乎专栏 | 多维度架构 |
首先,删除私钥
[root@netkiller ~]# gpg --delete-secret-keys E1C21F034FC0ACBF1337EE905E27578A03F0B510 gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. sec rsa2048/5E27578A03F0B510 2021-10-08 Netkiller (Test Key) <netkiller@msn.com> Delete this key from the keyring? (y/N) y This is a secret key! - really delete? (y/N) y
然后,删除公钥
[root@netkiller ~]# gpg --delete-key E1C21F034FC0ACBF1337EE905E27578A03F0B510 gpg (GnuPG) 2.2.20; Copyright (C) 2020 Free Software Foundation, Inc. This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. pub rsa2048/5E27578A03F0B510 2021-10-08 Netkiller (Test Key) <netkiller@msn.com> Delete this key from the keyring? (y/N) y
最后,查看密钥,并确认删除
[root@netkiller ~]# gpg --list-keys gpg: checking the trustdb gpg: marginals needed: 3 completes needed: 1 trust model: pgp gpg: depth: 0 valid: 1 signed: 0 trust: 0-, 0q, 0n, 0m, 0f, 1u gpg: next trustdb check due at 2023-10-08 /root/.gnupg/pubring.kbx ------------------------ pub rsa2048 2021-10-08 [SC] [expires: 2023-10-08] 70CECE32E5D67D12B95ED1E7F01C0CAEAAA458E6 uid [ultimate] Neo Chen <netkiller@msn.com> sub rsa2048 2021-10-08 [E] [expires: 2023-10-08]