SUSE Support

Here When You Need Us

How to generate entropy in SLES 11 SP1 and Later

This document (7011351) is provided subject to the disclaimer at the end of this document.

Environment

SUSE Linux Enterprise Server 11 Service Pack 1 (SLES 11 SP1)
SUSE Linux Enterprise Server 11 Service Pack 2 (SLES 11 SP2)
SUSE Linux Enterprise Server 11 Service Pack 3 (SLES 11 SP3)
SUSE Linux Enterprise Server 11 Service Pack 4 (SLES 11 SP4)
SUSE Linux Enterprise Server 12 Service Pack 1 (SLES 12 SP1)
SUSE Linux Enterprise Server 12 Service Pack 2 (SLES 12 SP2)
SUSE Linux Enterprise Server 12 Service Pack 3 (SLES 12 SP3)
SUSE Linux Enterprise Server 12 Service Pack 4 (SLES 12 SP4)
SUSE Linux Enterprise Server 15
SUSE Linux Enterprise Server 15 Service Pack 1 (SLES15 SP1)

Situation

Installation of certain applications that use /dev/random may be slow or it may hang while generating cryptographic information.
Doing cat /dev/random returns only a few characters (instead of a constant stream).
Entropy value from command /sbin/sysctl kernel.random.entropy_avail is less than 1000.

Resolution

Starting with SLES 11 SP1 "haveged" package is the recommended way of generating entropy, this package has to be installed and enabled as shown below.  In SLES 11 SP2 "haveged" is installed and enabled by default.

Steps to install and enable haveged:

  1.   Install haveged.  e.g zypper in haveged
  2.   On SLES11, start haveged. /etc/init.d/haveged start
  3.   On SLES12 and later, start haveged: systemctl start haveged
  4.   On SLES11, enable haveged to start at boot. chkconfig haveged on
  5.   On SLES12 and later, enable haveged to start on boot: systemctl enable haveged
  6. Reboot the SLES server.  The boot process generates a lot of entropy.  If you reboot twice, you get even  more entropy.
  7.   Verify by doing:
cat /dev/random
You should see a continual stream of random characters.
/sbin/sysctl kernel.random.entropy_avail 
or
cat /proc/sys/kernel/random/entropy_avail
This number should be 1000+.

Additional Information

haveged should work on physical and virtual machines.

For more information see: http://www.issihosts.com/haveged/

Disclaimer

This Support Knowledgebase provides a valuable tool for SUSE customers and parties interested in our products and solutions to acquire information, ideas and learn from one another. Materials are provided for informational, personal or non-commercial use within your organization and are presented "AS IS" WITHOUT WARRANTY OF ANY KIND.

  • Document ID:7011351
  • Creation Date: 12-Nov-2012
  • Modified Date:03-Mar-2020
    • SUSE Linux Enterprise Server

< Back to Support Search

For questions or concerns with the SUSE Knowledgebase please contact: tidfeedback[at]suse.com

tick icon

SUSE Support Forums

Get your questions answered by experienced Sys Ops or interact with other SUSE community experts.

tick icon

Support Resources

Learn how to get the most from the technical support you receive with your SUSE Subscription, Premium Support, Academic Program, or Partner Program.

tick icon

Open an Incident

Open an incident with SUSE Technical Support, manage your subscriptions, download patches, or manage user access.