我们的熵非常低(HTTPS apache 服务器,Ubuntu 12.04,不是 VM,硬件:使用联想 ThinkCentre M58):
root@server:~# cat /proc/sys/kernel/random/entropy_avail
417
root@server:~#
我们需要更多的随机性,因此:
root@server:~# apt-get install rng-tools
... ok!
但启动时:
root@server:~# service rng-tools start
Starting Hardware RNG entropy gatherer daemon: (failed).
root@server:~#
配置是默认的:
root@server:~# egrep -v '^$|^#' /etc/default/rng-tools
root@server:~#
用手尝试:
root@server:~# /usr/sbin/rngd
can't open /dev/hwrng: No such device
root@server:~#
11:29 是我们安装 rng-tools 的时候:
root@server:~# ls -lah /dev/hwrng
crw------- 1 root root 10, 183 jan 6 11:29 /dev/hwrng
root@server:~#
尝试 strace:
root@server:# strace /usr/sbin/rngd 2>&1 | grep hwrng
open("/dev/hwrng", O_RDONLY|O_LARGEFILE) = -1 ENODEV (No such device)
write(2, "can't open /dev/hwrng: No such d"..., 37can't open /dev/hwrng: No such device) = 37
root@server:#
问题:如何让“/dev/hwrng”与 rngd 一起工作?还是我们的硬件有问题?还是缺少一些 BIOS 设置?如何在不停机的情况下解决/检查它?
答案1
apt-get install haveged
和:
user@server:~$ cat /proc/sys/kernel/random/entropy_avail
2417
user@server:~$