17

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

2 Answers 2

13

For me, deleting the .gnugpg folder helped:

sudo rm -rf ~/.gnugpg
2
  • 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, 2016 at 19:49
  • This didn't worked for me on 17.10 Nov 15, 2017 at 8:18
9

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.

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .