GPG 无法删除密钥
我试图删除在我的服务器中生成的 GPG 私钥和公钥。我收到一条错误消息“gpg:删除密钥失败:设备的 ioctl 不合适”。快速谷歌搜索,我输入“export GPG_TTY=$(tty)”来修复 ioctl 错误。
现在,当我尝试再次删除密钥时,会出现错误,并显示“gpg:删除密钥失败:没有这样的文件或目录”。你们以前遇到过这种情况吗?
root@blahblah:/# gpg --delete-secret-keys 840AF4E6
gpg (GnuPG) 2.2.27; Copyright (C) 2021 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/34D79E35840AF4E6 2022-02-23 Autogenerated Key <[email protected]>
Delete this key from the keyring? (y/N) Y
This is a secret key! - really delete? (y/N) Y
gpg: deleting secret key failed: No such file or directory
gpg: 840AF4E6: delete key failed: No such file or directory
I was trying to delete the GPG private and public keys that were generated in my server. I got an error saying "gpg: deleting secret key failed: Inappropriate ioctl for device". A quick google search and i typed "export GPG_TTY=$(tty)" to fix the ioctl error.
Now when I try to delete the secret keys again, it errors out with "gpg: deleting secret key failed: No such file or directory". Have you guys encountered this before?
root@blahblah:/# gpg --delete-secret-keys 840AF4E6
gpg (GnuPG) 2.2.27; Copyright (C) 2021 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/34D79E35840AF4E6 2022-02-23 Autogenerated Key <[email protected]>
Delete this key from the keyring? (y/N) Y
This is a secret key! - really delete? (y/N) Y
gpg: deleting secret key failed: No such file or directory
gpg: 840AF4E6: delete key failed: No such file or directory
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我使用 python 的 gnupg 模块来创建这些键。阅读文档后,我找到了删除密钥的方法。
I used python's gnupg module to create these keys. After reading the docs, I found a way to delete the secret keys.
在您的 zprofile 或 bashprofile 上尝试此操作:
重新启动终端并尝试再次删除它。
Try this on your zprofile or bashprofile:
Restart the terminal and try to delete it again.