9

Whenever I try to generate a gpg key through the system's GPG program, it asks for my name, email, and password then everything except for the GPG program's main window disappears.

Upon using 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
8

For me, deleting the .gnugpg folder helped:

sudo rm -rf ~/.gnugpg
  • That is what eventually worked for me. I must have forgotten to come back and put the answer here. Thank you for your response. – KI4JGT Mar 12 '16 at 19:49
  • This didn't worked for me on 17.10 – Danny van der Knaap Nov 15 '17 at 8:18
4

Permissions might be wrong after you ran gpg from root, making it impossible to modify one/some of the files as ordinary user "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 {} \;

In case case you don't want to delete any existing keys, this will be helpful.

  • Sockets present on that location also should be owned by $USER:$USER? You can just use $USER:$USER, your current user. – Pablo A Aug 2 at 2:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.