我有一个NeuG硬件真正的随机数生成器(http://www.gniibe.org/memo/development/gnuk/rng/neug.html),它的页面显示它以/dev/ttyACM0的形式在GNU系统上运行
我可以配置/dev/random来使用NeuG,因为它的随机性吗?如果是这样的话,是怎么做的?如何检查/dev/random是否确实在使用NeuG?
发布于 2017-03-27 19:01:14
改编自SuperUser:https://superuser.com/questions/309840/how-can-i-point-dev-random-to-dev-urandom的答案
您所需要做的就是创建类似于/etc/udev/rules.d/70-harware-randomizer-enable.rules的内容如下:
# /etc/udev/rules.d/70-disable-random-entropy-estimation.rules
# Disables /dev/random entropy estimation (it's mostly snake oil anyway).
#
# udevd will warn that the kernel-provided name 'random' and NAME= 'ttyACM0'
# disagree. You can ignore this warning.
# Use /dev/ttyACM0 instead of /dev/random for the entropy-estimating RNG.
KERNEL=="random", NAME="ttyACM0"
# Remove any existing /dev/random, then create symlink /dev/random pointing to
# /dev/urandom
KERNEL=="urandom", PROGRAM+="/bin/rm -f /dev/random", SYMLINK+="random"发布于 2018-03-25 11:13:31
我不记得我还做过什么,但是我似乎用以下方法创建了/etc/systemd/system/rngd@.service:
[Unit]
Description=rngd service on %I
[Service]
Type=simple
ExecStartPre=/bin/stty -F /dev/%I raw -echo -parenb
ExecStart=/usr/sbin/rngd -f --fill-watermark=4000 --rng-device=/dev/%I然后,sudo systemctl enable rngd@ttyACM0.service和sudo systemctl start rngd@ttyACM0.service
https://unix.stackexchange.com/questions/354188
复制相似问题