每当我尝试通过系统的 GPG 程序生成 gpg 密钥时,它都会要求输入我的姓名、电子邮件和密码,然后除了 GPG 程序主窗口之外的所有内容都会消失。
使用时gpg key-gen
gpg: can't open `/home/jesse/.gnupg/random_seed': Permission denied
We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.
gpg: WARNING: some OpenPGP programs can't handle a DSA key with this digest size
+++++++++++++++..++++++++++...+++++++++++++++.+++++..+++++.+++++.++++++++++.+++++++++++++++..+++++.++++++++++++++++++++.++++++++++++++++++++++++++++++.+++++.+++++.+++++...+++++>+++++...+++++++++++++++++++++++++..+++++++++++++++>.+++++>+++++................................................................................................................................................................................................................................................................................>.+++++.................................................................................................................+++++
Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 300 more bytes)
gpg: no writable public keyring found: eof
Key generation failed: eof
gpg: note: random_seed file not updated
答案1
对我来说,删除该.gnugpg
文件夹有帮助:
sudo rm -rf ~/.gnugpg
答案2
从 root 运行 gpg 后,权限可能出现错误,导致无法以普通用户“joey”的身份修改某个/某些文件。
find ~/.gnupg -type d -exec sudo chown joey:joey {} \; -exec chmod 700 {} \;
find ~/.gnupg -type f -exec sudo chown joey:joey {} \; -exec chmod 600 {} \;
如果您不想删除任何现有密钥,这将会有所帮助。