It's a file like device, so you can do things like cat it or copy from it. For instance:
dd if=/dev/urandom of=~/urandom_test count=4 bs=1024
Creates a file containing 4K of random bytes.
cat /dev/urandom > ~/urandom_test2
Will continue to write random bytes to that file until you hit Ctrl-C. Don't do this on a low performing system...
head -30 /dev/urandom > ~/urandom_test3
Will write 30 lines of random bytes
This is complicated question. I will answer by quoting from few sources.
From Linux manpage
The character special files /dev/random and /dev/urandom (present
since Linux 1.3.30) provide an interface to the kernel's random number
generator. File /dev/random has major device number 1 and minor device
number 8. File /dev/urandom has major device number 1 and minor device
number 9.
The random number generator gathers environmental noise from device
drivers and other sources into an entropy pool. The generator also
keeps an estimate of the number of bits of noise in the entropy pool.
From this entropy pool random numbers are created.
In Ubuntu 12.04 default kernel is 3.11.
From wiki
The Linux kernel generates entropy from keyboard timings, mouse
movements, and IDE timings and makes the random character data
available to other operating system processes through the special
files /dev/random and /dev/urandom. This capability was introduced in
Linux version 1.3.30.
From Linux manpage
When read, the /dev/random device will only return random bytes within
the estimated number of bits of noise in the entropy pool. /dev/random
should be suitable for uses that need very high quality randomness
such as one-time pad or key generation. When the entropy pool is
empty, reads from /dev/random will block until additional
environmental noise is gathered.
Quote from random
sources, from kernel 3.11.10.10
* Theory of operation
* ===================
*
* Computers are very predictable devices. Hence it is extremely hard
* to produce truly random numbers on a computer --- as opposed to
* pseudo-random numbers, which can easily generated by using a
* algorithm. Unfortunately, it is very easy for attackers to guess
* the sequence of pseudo-random number generators, and for some
* applications this is not acceptable. So instead, we must try to
* gather "environmental noise" from the computer's environment, which
* must be hard for outside attackers to observe, and use that to
* generate random numbers. In a Unix environment, this is best done
* from inside the kernel.
*
* Sources of randomness from the environment include inter-keyboard
* timings, inter-interrupt timings from some interrupts, and other
* events which are both (a) non-deterministic and (b) hard for an
* outside observer to measure. Randomness from these sources are
* added to an "entropy pool", which is mixed using a CRC-like function.
* This is not cryptographically strong, but it is adequate assuming
* the randomness is not chosen maliciously, and it is fast enough that
* the overhead of doing it on every interrupt is very reasonable.
* As random bytes are mixed into the entropy pool, the routines keep
* an *estimate* of how many bits of randomness have been stored into
* the random number generator's internal state.
Yes it is smart enough to use user based sources, but you can configure more if you want.
There are kernels with random generators that have more entropy sources such including noise on audio inputs and others like video, coolers censors, etc. Look here if interesting in audio entropy. I hope you will find others kernels by yourself.
But /dev/random
should be enough for most tasks by default.
Also read this question on stackoverflow
Best Answer
Check /proc/sys/kernel/panic, if it's value is 1 then server will immediately reboot on panic. Bad drivers can cause kernel panic.
If it's not panic check last issue of reboot, maybe overheating is the issue.