我无法通过密钥环程序生成gpg密钥


10

每当我尝试通过系统的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

Answers:


9

对我来说,删除.gnugpg文件夹有助于:

sudo rm -rf ~/.gnugpg

那才是最终对我有用的东西。我一定忘了回来,把答案放在这里。感谢您的答复。
KI4JGT '16

这在17.10上对我
不起作用

4

从根目录运行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 {} \;

如果您不想删除任何现有密钥,这将很有帮助。


该位置上存在的套接字也应该由$ USER:$ USER拥有吗?您可以只使用$USER:$USER当前用户。
Pablo Bianchi
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.