I am trying to generate a GPG key, and I cannot generate enough entropy. So I installed rng-tools
and tried following these instructions: https://serverfault.com/questions/214605/gpg-not-enough-entropy
When I am logged in as root, and try to run rngd -r /dev/urandom
I get the following error: can't open /dev/random: Permission denied
I find this disturbing as I am root.
This is Ubuntu on a virtual server (via Parallels I believe.)
/dev/random
or/dev/urandom
? The error is the former but the command is the latter, andrngd
source suggests they should be the same.In any case,
/dev/random
is the correct one;/dev/urandom
doesn't have a kernel interface for adding entropy, which is why the open fails (not evenroot
can force the kernel to allow writes to a non-writable device, although arguably it should produce a more appropriate error likeEINVAL
or maybeEPERM
). The kernel will feed/dev/urandom
from/dev/random
automatically.