0

The rngd program comes from package rng-tools5 on Ubuntu/Debian.


# neofetch 
             ...-:::::-...                 root@dell-7577 
          .-MMMMMMMMMMMMMMM-.              -------------- 
      .-MMMM`..-:::::::-..`MMMM-.          OS: Linux Mint 21.1 x86_64 
    .:MMMM.:MMMMMMMMMMMMMMM:.MMMM:.        Host: Inspiron 7577 
   -MMM-M---MMMMMMMMMMMMMMMMMMM.MMM-       Kernel: 5.15.0-57-generic 
 `:MMM:MM`  :MMMM:....::-...-MMMM:MMM:`    Uptime: 32 mins 
 :MMM:MMM`  :MM:`  ``    ``  `:MMM:MMM:    Packages: 3489 (dpkg), 45 (flatpak), 11 (snap) 
.MMM.MMMM`  :MM.  -MM.  .MM-  `MMMM.MMM.   Shell: bash 5.1.16 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   Resolution: 1920x1080 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM:MMM:   DE: Cinnamon 5.6.5 
:MMM:MMMM`  :MM.  -MM-  .MM:  `MMMM-MMM:   WM: Mutter (Muffin) 
.MMM.MMMM`  :MM:--:MM:--:MM:  `MMMM.MMM.   WM Theme: Mint-Y-Dark-Aqua (Mint-Y) 
 :MMM:MMM-  `-MMMMMMMMMMMM-`  -MMM-MMM:    Theme: Mint-Y-Aqua [GTK2/3] 
  :MMM:MMM:`                `:MMM:MMM:     Icons: Mint-Y-Aqua [GTK2/3] 
   .MMM.MMMM:--------------:MMMM.MMM.      Terminal: gnome-terminal 
     '-MMMM.-MMMMMMMMMMMMMMM-.MMMM-'       CPU: Intel i7-7700HQ (8) @ 3.800GHz 
       '.-MMMM``--:::::--``MMMM-.'         GPU: NVIDIA GeForce GTX 1060 Mobile 
            '-MMMMMMMMMMMMM-'              GPU: Intel HD Graphics 630 
               ``-:::::-``                 Memory: 1158MiB / 31839MiB 

                                                                   
                                                                   


# rngd -v
Available entropy sources:
    Intel/AMD hardware rng
    DRNG

The above is a relatively new laptop (3.5 years old), having 7th gen of Intel CPU which is combined with the TPM 2.0 (however I do not know if rngd uses it by default). As you can see there is no error message produced, so I assume it is working well as it is without special settings. Note: the DRNG I do not know what that is.


root @ acer-5742g /root # neofetch 
            .-/+oossssoo+/-.               root@acer-5742g 
        `:+ssssssssssssssssss+:`           --------------- 
      -+ssssssssssssssssssyyssss+-         OS: Ubuntu 22.04.1 LTS x86_64 
    .ossssssssssssssssssdMMMNysssso.       Host: Aspire 5742G V1.24 
   /ssssssssssshdmmNNmmyNMMMMhssssss/      Kernel: 5.15.0-57-generic 
  +ssssssssshmydMMMMMMMNddddyssssssss+     Uptime: 36 mins 
 /sssssssshNMMMyhhyyyyhmNMMMNhssssssss/    Packages: 2099 (dpkg), 8 (snap) 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Shell: bash 5.1.16 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Resolution: 1920x1080 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM: Mutter (Muffin) 
ossyNMMMNyMMhsssssssssssssshmmmhssssssso   WM Theme: () 
+sssshhhyNMMNyssssssssssssyNMMMysssssss+   Theme: Adwaita [GTK3] 
.ssssssssdMMMNhsssssssssshNMMMdssssssss.   Icons: Adwaita [GTK3] 
 /sssssssshNMMMyhhyyyyhdNMMMNhssssssss/    Terminal: /dev/pts/0 
  +sssssssssdmydMMMMMMMMddddyssssssss+     CPU: Intel Pentium P6200 (2) @ 2.133GHz 
   /ssssssssssshdmNNNNmyNMMMMhssssss/      GPU: NVIDIA GeForce GT 520M 
    .ossssssssssssssssssdMMMNysssso.       GPU: Intel Core Processor 
      -+sssssssssssssssssyyyssss+-         Memory: 689MiB / 3597MiB 
        `:+ssssssssssssssssss+:`
            .-/+oossssoo+/-.                                       
                                                                   


root @ acer-5742g /root # rngd -v
read error

read error

Available entropy sources:
    Intel/AMD hardware rng

By contrast, the second computer above is many years old, and running rngd produces two errors, I mean:

read error

Does this somehow affect the randomness rngd delivers to these old machines and do they need to adjust the rngd settings somehow, and if so, then how or what should I do?

Thanks.

Man page: https://linux.die.net/man/8/rngd

Note on DRNG:

Digital Random Number Generator; it is an Intel hardware approach to high-quality, high-performance entropy and random number generation using the RDRAND processor instruction. Check with:

grep -m1 rdrand /proc/cpuinfo

systemctl status rngd -l

on the old computer produces this:

○ rngd.service - Start entropy gathering daemon (rngd)
     Loaded: loaded (/lib/systemd/system/rngd.service; enabled; vendor preset: enabled)
     Active: inactive (dead) since Fri 2023-01-06 06:03:46 CET; 1h 19min ago
       Docs: man:rngd(8)
    Process: 619 ExecStart=/usr/sbin/rngd -f (code=exited, status=0/SUCCESS)
   Main PID: 619 (code=exited, status=0/SUCCESS)
        CPU: 2ms

Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: read error
Jan 06 06:03:45 acer-5742g rngd[619]: No entropy sources working, exiting rngd
Jan 06 06:03:46 acer-5742g systemd[1]: rngd.service: Deactivated successfully.

1 Answer 1

1

Caution: This is a pseudo solution because you fill in the /dev/random device with data from the /dev/urandom device.


Edit this file with your favorite editor:

/etc/systemd/system/multi-user.target.wants/rngd.service

Replace:

ExecStart=/usr/sbin/rngd -f

With:

ExecStart=/usr/sbin/rngd -f -r /dev/urandom

After saving that file, run:

systemctl daemon-reload && systemctl restart rngd.service

Check if working afterward:

# systemctl status rngd -l
● rngd.service - Start entropy gathering daemon (rngd)
     Loaded: loaded (/lib/systemd/system/rngd.service; enabled; vendor preset: enabled)
     Active: active (running) since Fri 2023-01-06 08:07:33 CET; 8s ago
       Docs: man:rngd(8)
   Main PID: 4757 (rngd)
      Tasks: 1 (limit: 4173)
     Memory: 224.0K
        CPU: 2ms
     CGroup: /system.slice/rngd.service
             └─4757 /usr/sbin/rngd -f -r /dev/urandom

Jan 06 08:07:33 acer-5742g systemd[1]: Started Start entropy gathering daemon (rngd).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .