Linux – Is it wrong to link /dev/random to /dev/urandom on Linux

linuxrandomSecurity

I'm currently testing gpg --genkey on a Linux VM. Unfortunately, this software seems to rely on /dev/random to gather entropy and politely asks the user to manually type screens after screens of cryptographically random input so it may eventually end-up with generating a key, and I've found no command-line parameter to tell it to use another file as entropy source (the guy on this video encounters the very same issue…).

However, the user should be free to choose to use /dev/urandom instead since there is nothing wrong with it. It is there mainly as a reminiscence of older PRNG algorithms which were weaker from a cryptographic point of view. For instance, while NetBSD manpage grants that the distinction may still be useful at very early booting stage, it describes such distinction as "folklore" and an "imaginary theory that defends only against fantasy threat models". Not anybody agrees with either the amount of entropy required by this command nor the fact that entropy is something which is actually actually consumed as stated in GPG manpage ("PLEASE, don't use this command unless you know what you are doing, it may remove precious entropy from the system!").

I've read about people installing the rngd daemon and configure it to use /dev/urandom as entropy source to feed /dev/random, but I find such practice heavily dirty.

I tried to workaround the problem in the FreeBSD way by removing /dev/random and linking it to /dev/urandom instead:

rm /dev/random
ln -s /dev/urandom /dev/random

I see this as a setting telling "I trust /dev/urandom as entropy source".

I feared I would encounter some error of some kind, but this seems to provide the expected result since the command now returns successfully immediately.

My question is: is there any known, practical and wrong side-effect of linking /dev/random to /dev/urandom on Linux systems as done by default on FreeBSD systems? Or could one envisage to set this permanently (in a script at the end of the boot process for instance) in case of repetitive issues due to /dev/random locking some service?

Best Answer

See Myths about urandom, there is no known attack on /dev/urandom that would not also be an attack on /dev/random. The main problem that a Linux system has is when it cloned and run as several VMs without resetting the saved entropy pool after the cloning. That is a corner case that tangential to what you want.