RNGD(8)
π RNGD(8) β System Manager's Manual π
okay bestie, gather round, because we're about to talk about rngd, from section 8 of your System Manager's Manual. yes, the entropy girlie. the one feeding the kernel's random pool. she's lowkey the most important daemon you've never thought about. π
β¨ NAME β¨
rngd β Check and feed random data from hardware device to kernel random device
like. that's the whole job description. she checks the random, and then she feeds the random. iconic behavior honestly. π
β¨ SYNOPSIS β¨
rngd [-b, --background] [-f, --foreground] [-d, --debug] [-l, --list]
[-x, --exclude] [-n, --include] [-O, --option] [-i, --ignorefail] [-o,
--random-device=file] [-p, --pid-file=file] [-r, --rng-device=file] [-s,
--random-step=nnn] [-t, --test] [-W, --fill-watermark=nnn] [-R, --force-
reseed=nnn] [-u, --use-slow-sources] [-D, --drop-privileges=user:group]
[-q, --quiet] [-?, --help] [-v, --version]
look at all those flags. she's got range. π
β¨ DESCRIPTION β¨
So here's the vibe: this daemon feeds data from a random number generator to the kernel's random number entropy pool, but β and this is the part people skip β she does it after first checking the data to ensure that it is properly random. she's not just dumping numbers in there, she's a curator. vibe check first, always. π¦
Now, the forking. The -f or --foreground options can be used to tell rngd to avoid forking on startup. that's typically what you want when you're debugging β you want her right there in your terminal, in plain sight, telling you everything. main character energy, no hiding.
meanwhile the -b or --background options, which fork and put rngd into the background automatically, are the default. so if you don't say anything, she's already gone, doing her thing in the background like a responsible queen. π
Now let's talk sources. The -r or --rng-device options can be used to select an alternate source of input, besides the default /dev/hwrng. and the -o or --random-device options can be used to select an alternate entropy output device, besides the default /dev/random.
β οΈ heads up bestie: Note that this device must support the Linux kernel /dev/random ioctl API. so don't just point it at any old file and expect magic. she has requirements. π
β¨ OPTIONS β¨
okay here's the full menu, no skips, no cuts, every single one:
-b,--backgroundβ Become a daemon (default). the girl is going to the background whether you asked or not. this is her default setting. π«Ά-f,--foregroundβ Do not fork and become a daemon. stay here. with me. in the terminal. π₯Ί-d,--debugβ Enable debug messages. she'll overshare and honestly we love that for her.-l,--listβ List the indexes and names of available entropy sources. and listen β exit code when listing sources is0if at least 1 entropy source was found and initialized,1otherwise. so you can script against it. iykyk. β¨-x,--excludeβ Disable entropy sources based on index or (shortname) reported from the--listoption. not feeling that source today? block her. π-n,--includeβ Enable entropy sources based on index or (shortname) reported from the--listoption. the unblock. welcome back babe. π-O,--optionβ Provide specific config options to individual entropy sources, in the format--option [index|shortname]:key:value. See the Entropy Sources section below for indices and source specific options. and note: specifying-O [<index>|<shortname>]will print the available options for that index to the console. it's like a little menu. we love a helpful girlie. π-pfile,--pid-file=file β File used for recording daemon PID, and multiple exclusion (default:/var/run/rngd.pid). her little name tag. π-i,--ignorefailβ Ignore repeated fips failures. you're choosing peace. noted. π-ofile,--random-device=file β Kernel device used for random number output (default:/dev/random). where the randomness goes. β-rfile,--rng-device=file β Kernel device used for random number input (default:/dev/hwrng). where the randomness comes from. π₯-snnn,--random-step=nnn β Number of bytes written to random-device at a time (default:64). sip, not chug. π-t,--testβ Enter test mode. and listen to this: in this mode (which implies-f), all generated entropy is discarded andrngdreports the amount of entropy generated every second. so it's a vibe check for the vibe checker. π-ennn,--entropy-count=nnn β Number of bits to consider random when adding entropy.1<=e<=8(default:8). do the math bestie, stay in range. π-Wn,--fill-watermark=nnn β Once we start doing it, feed entropy to random-device until at least fill-watermark bits of entropy are available in its entropy pool. By default, this value is set to 75% of the entropy pool size, or 2048 bits if the entropy pool size couldn't be determined. Setting this too high will causerngdto dominate the contents of the entropy pool. Low values will hurt system performance during entropy starves. Do not set fill-watermark above the size of the entropy pool (usually 256 bits). and a value of0to this option will cause no watermark to be set. that's a lot of rules but they're there for a reason, trust. β οΈ-Rn,--force-reseed=nnn β For newer kernels which support non-blocking entropy pools, it is still beneficial to periodically add fresh entropy as a reseeding event.--force-reseeddefines the number of seconds between which fresh entropy is added to the kernel entropy pool. Defaults to 5 minutes. a little refresh, a little self care. πΈ-u,--use-slow-sourcesβ The entropy sourcesnist,jitterandpkcs11are considered to be slow in providing entropy. By default their data is only used after all other sources failed to provide valid entropy a 100 times over. With this optionrngdalways tries to gather entropy from these sources too. so basically: stop ghosting the slow girlies. π§-D,--drop-privileges=user:group β Drop privileges to a user and a group specified after initialization. A user and a group can be specified as a name or as a numerical id and must be separated with a colon. A user and a group must exist. A default is not to drop privileges. safety first, bestie, seriously. π-q,--quietβ Suppress all messages. silent. mysterious. π€-?,--helpβ Give a short summary of all program options. the tl;dr. π-v,--versionβ Print program version. knowing exactly which girlie you're running is self care. β¨
that's the main event, but we are not done β there's more. keep scrolling, bestie. π
π ENTROPY SOURCES π
Okay bestie, here's the tea: rngd isn't just one thing, it's a whole squad of entropy sources π. All of their data gets aggregated and fed into the kernel's entropy pool. Iconic teamwork, honestly.
But like β heads up π«Ά β not every entropy source is available on every system. If you enable one for a system where it's not appropriate (or not even possible), it may fail initialization. And guess what? That's not fatal. rngd does not care if any single entropy source dies during startup, because it only needs one to operate. One is enough. Periodt. π
The following entropy sources are currently defined in rngd:
π Hardware RNG (hwrng)
The Hardware RNG is a generic entropy source that draws entropy from a hardware rng attached by default to /dev/hwrng.
π TPM (tpm)
Entropy drawn from an on board TPM device.
β οΈ Bestie, this one is deprecated and will be removed soon. Newer tpm devices export entropy via/dev/hwrnginstead, which thehwrngsource above already collects. It's giving obsolete, fr fr.
π₯ RDRAND/RDSEED (rdrand)
Entropy drawn from the RDRAND and RDSEED instructions (x86 only, so if you're not on x86, this vibe check fails).
Options
use_aesβ pick whetherrdrandis used to seed a cprng to produce entropy, or whether all entropy is drawn directly from therdrandinstruction. Default:0.
β DARN (darn)
Entropy drawn from the DARN instruction (ppc64 only).
Options
use_aesβ pick whether the power darn instruction is used to directly fill the entropy poll, or whether it's used as a periodic seed to an aes based cprng. Default:1.
π RNDR (rndr)
Entropy drawn from the RNDR instruction (aarch64 only).
Options
use_aesβ pick whether the arm rndr instruction is used to directly fill the entropy poll, or whether it's used as a periodic seed to an aes based cprng. Default:0.
πΈ NIST Entropy Beacon (nist)
Entropy gathered from the NIST network entropy beacon.
π No cap: this source is disabled by default, because it should never be used for cryptographic purposes β or for any use case where random data should be known only by a single entity. That's the whole point of random, babes.
π¦ Qrypt Entropy Beacon (qrypt)
Entropy gathered from the qrypt entropy beacon. Note that this beacon provides entropy to remote clients over a TLS connection.
π¨ So listen: this source should not be used for cryptographic operations unless the security of the network can be guaranteed against man in the middle and other network based attacks. Main character energy, but on a public network? Absolutely not.
Options
tokenfileβ specify the file containing the access token to the Qrypt beacon.delayβ specify the maximum delay (in seconds) that the source will wait when there are temporary conditions preventing entropy retrieval, before trying to fetch entropy again. The default maximum delay is eight hours, exponentially counting up from one second upwards, in powers of two. π
β¨ JITTER (jitter)
Entropy gathered by measuring timing variance of operations on the local cpu. So chaotic. So effective. π
Options
thread_countβ set the number of threads that the jitter entropy source will spawn.buffer_sizeβ set the size of the buffer cache that each thread maintains.refill_threshβ set the low watermark for the cache that triggers its corresponding thread to start refill operations.retry_countβ if all entropy buffers are empty, retry this many times before giving up. Note that jitterentropy can take several seconds to refill a buffer, and so retries after a delay may be preferable to repeatedly spining on an empty buffer. Default:1.retry_delayβ between each retry forretry_countabove, sleep for this many seconds. May also be the special value-1, representing adaptive sleep, where each retry delay will be half the recorded execution time of the last entropy gathering round. Default:-1.force_soft_timerβ on platforms with a hardware timer that is too coarse to sample jitter, we can instead use a software based timer loop. Detection and use of this mechanism is automatic, but this can be useful for testing purposes.
π PKCS11 (pkcs11)
Entropy gathered via the opensc openssl engine, which can extract entropy from various smart card readers. π³β¨ Install a package for your distribution containing a pkcs11 endpoint library to gather smartcard entropy: that's opensc for Fedora, opensc-pkcs11 for Debian/Ubuntu, or another package containing opensc-pkcs11.so.
Options
engine_pathβ set the path for the pkcs11 engine DSO to load.chunk_sizeβ some pkcs11 engines have restrictions on how much data can be requested at a time; this option allows for the request to be subdivided into smaller chunks to be satisfied.
π» RTLSDR (rtlsdr)
Entropy gathered via the rtl software defined radio library, which can gather entropy using various usb software defined radios listening to random radio static. Literally pulling randomness out of thin air, obsessed. π«οΈπ
Options
devidβ when multiple devices are available, the integer index of the device to use.freq_minβ the minimum frequence range to scan in.freq_maxβ the maximum frequency range to scan in.sample_minβ the minimum sample rate of the radio.sample_maxβ the maximum sample rate of the radio.
π§ Named pipe (namedpipe)
Reads entropy from a named pipe (aka FIFO). Another program β for example a driver reading and preparing data from an external hardware RNG β is expected to feed entropy into this named pipe. And should the named pipe be closed? rngd will try to reopen it. Resilient queen. π
Options
pathβ path of the named pipe. Required.timeoutβ maximum time in secondsrngdwaits until a full FIPS test buffer of entropy can be read. Defaults to5.
π«Ά AUTHORS π«Ά
Give it up for the legends who made this happen:
- Philipp Rumpf
- Jeff Garzik β
jgarzik@pobox.com - Matt Sottek
- Brad Hill
- Neil Horman β
nhorman@tuxdriver.com
And that's the whole page, bestie!! πβ¨ This was rng-tools 6.17, dated March 2001 β yes, your fave vintage classic still serving entropy after all these years. Slay, stay random, and protect that pool. ππ Byeeee π
π¦ where this page comes from
- alpine 3.22: rng-tools-doc 6.17-r0 Β· GPL-2.0-or-later
- alpine 3.23: rng-tools-doc 6.17-r0 Β· GPL-2.0-or-later
- alpine 3.24: rng-tools-doc 6.17-r2 Β· GPL-2.0-or-later
- arch rolling: rng-tools 6.17-3 Β· GPL-2.0-or-later
- fedora 43: rng-tools 6.17-7.fc43 Β· GPL-2.0-or-later
- fedora 44: rng-tools 6.17-8.fc44 Β· GPL-2.0-or-later
- nixos 26.05: rng-tools 6.17
- nixpkgs unstable: rng-tools 6.17
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- opensuse-leap 16.0: rng-tools 6.17-bp160.1.10 Β· GPL-3.0-or-later
- ubuntu stonking: rng-tools 6.17-3 Β· GPL-2.0-or-later
- Copyright (C) 2017 - Neil Horman <nhorman@tuxdriver.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms