Documentation Index
Fetch the complete documentation index at: https://mintlify.com/imthenachoman/How-To-Secure-A-Linux-Server/llms.txt
Use this file to discover all available pages before exploring further.
Why This Matters
Entropy is randomness collected by the operating system from various sources (keyboard timings, mouse movements, disk activity, network traffic). This randomness is crucial for:- Generating cryptographic keys
- Creating secure random numbers
- SSL/TLS operations
- SSH key generation
- Password salt generation
What is rng-tools
Therng-tools package provides utilities for using hardware random number generators and feeding entropy into the system’s random number pool (/dev/random).
Installation and Configuration
Configure hardware device
Set the hardware device used to generate random numbers by adding this to Or use this command:
/etc/default/rng-tools:Checking Entropy Levels
You can check your current entropy level:Testing Randomness
To test the quality of random data:/dev/random and performs statistical tests on the randomness.
For production systems, especially virtualized environments, consider using hardware random number generators (if available) or entropy-gathering daemons like
haveged instead of or in addition to rng-tools.Additional Resources
- What is Entropy and How Do I Get More of It?
- Myths about /dev/urandom
- Arch Linux RNG Tools Guide
- Red Hat Security Guide - Random Number Generator
Notes
Virtual Machines
VMs often have low entropy. Consider using virtio-rng or haveged for better performance.
Hardware RNG
Modern CPUs have hardware RNG (RDRAND). rng-tools can utilize this if available.
/dev/random vs /dev/urandom
/dev/urandom is generally recommended for most use cases and won’t block on low entropy.
Monitoring
Monitor entropy levels regularly, especially during high-load periods.