i am using digitalocean and trying to install and start tomcat on ubuntu but unfortunately i can not do it. (created new droplets and tried 10 times)
1GB
While using /dev/urandom
as the source for entropy is a workaround that reduces the startup time for Tomcat, it is not a good idea because it can have unintended side effects.
Other components running in the Tomcat server (e.g. web applications) might depend on a securely initialized SecureRandom
instance and there might be security issues when the entropy for the random numbers is not sufficient.
Actually, this is one of the reasons why using /dev/urandom
does not work, but /dev/./urandom
does. The SHA1PRNG heavily relies on a good seed. If the seed is not good, the random numbers are predictable. Therefore, the developer ensured that for this purpose /dev/random
is used as the source of entropy, even if the JVM is configured to use /dev/urandom
. There are two bug reports about this (bug 1, bug 2).
So instead of changing the entropy source to /dev/urandom
, one should rather make sure that /dev/random
has enough entropy. If the system has a hardware RNG, installing rng-tools
should do the trick. Otherwise, installing haveged
provides a very good source of entropy that does not rely on a special hardware RNG to be present. In a virtual machine, rng-tools
can use entropy from the host through a virtual hardware RNG. As an alternative to this, EGD could be used, but at the moment this software is not included in the Ubuntu repositories, so that it is bothersome to use it.