在虚拟机或者某些服务器上没有DRNG/TPM, 运行rngd -v的结果:
#rngd -v
Unable to open file: /dev/tpm0
can't open any entropy source
Maybe RNG device modules are not loaded
这样的话,rngd.service 启动会出错,报错信息:loaded failed。
解决方法如下:
a.把rngd.service复制到自定义目录/etc/systemd/system
cp /usr/lib/systemd/system/rngd.service /etc/systemd/system
b.编辑/etc/systemd/system/rngd.service,改动ExecStart为如下:
ExecStart=/sbin/rngd -f -r /dev/urandom
c.重新载入systemd.
systemctl daemon-reload
d.重新启动rngd服务。
systemctl restart rngd
参考: