The Entropy Generator
Linux systems require a source of random data (entropy) for cryptographic tasks, such as generating SSH keys, encrypting disks, or establishing secure HTTPS connections. Historically, servers without hardware random number generators struggled to create enough entropy quickly, leading to slow boot times or delayed cryptographic operations. To solve this, administrators frequently installed haveged, a daemon that generates unpredictable data based on the microscopic variations in CPU execution times.
However, starting with Linux kernel version 5.6 (which is standard in modern Ubuntu releases like 22.04 and newer), the kernel’s internal random number generator (/dev/random) was completely overhauled. The kernel is now exceptionally good at gathering entropy from various hardware interrupts incredibly quickly. Because the modern Linux kernel handles entropy generation so efficiently on its own, running the external haveged.service is now considered entirely redundant and arguably less secure than relying on the kernel’s native cryptographic stack. If you have this legacy daemon running on a modern Ubuntu server, you should remove it.
How to Disable the Haveged Daemon
Because this daemon is an external package and not a core part of systemd, the best way to disable it is to remove the package entirely.
Warning: Only perform this on modern Ubuntu systems (kernel 5.6+). Do not remove this on ancient, legacy servers that rely on it for boot-time entropy.
- Open your Ubuntu Terminal or connect via SSH.
- Stop the active daemon:
sudo systemctl stop haveged.service
- To permanently disable and remove the software from your system, use the package manager:
sudo apt-get purge haveged
- (Optional) Clean up any leftover dependencies:
sudo apt-get autoremove
Your Ubuntu server will now rely exclusively on the modern, built-in Linux kernel mechanisms for generating high-quality cryptographic randomness, freeing up the CPU cycles previously consumed by haveged.