# How do I manually seed the FreeBSD RNG ?



## absduser (Dec 18, 2019)

I understand that the FreeBSD RNG is automatically seeded with various, robust sources of entropy.

I understand that I don't need to seed it and my seeding is probably worse than the default.

HOWEVER, just because I am curious, I wonder ...

I used to be able to set this sysctl:

sysctl -w kern.random.sys.seeded=0

.. and then start up sshd for the first time and I would be asked to mash the keyboard and type a page or two of gibberish to seed the RNG.

In 2019 with FreeBSD 12.1, how do I do that ?  How can I manually seed the RNG with my own keyboard mashing, even though that's probably not the best choice of seed ?

Thanks.


----------



## shkhln (Dec 18, 2019)

absduser said:


> In 2019 with FreeBSD 12.1, how do I do that ?  How can I manually seed the RNG with my own keyboard mashing



You tell us. That question doesn't match any common use cases.


----------



## Phishfry (Dec 18, 2019)

Have you looked at the script used to store entrophy at shutdown?
/etc/rc.d/random
Also the manual page for random(4)


----------



## Phishfry (Dec 18, 2019)

Why can't I manually seed the FreeBSD random number generator?
					

Years ago, I could manually seed the random number generator in FreeBSD by setting:  sysctl -w kern.random.sys.seeded=0  ... and then if I deleted my SSH keys (on purpose) and restarted sshd, I wou...




					serverfault.com


----------



## shkhln (Dec 18, 2019)

Same person, I suppose?


----------



## absduser (Dec 19, 2019)

So it would seem that this is no longer possible - one has to use the auto-rng-seeding and there is no other option ?


----------



## shkhln (Dec 19, 2019)

You have the complete source code for the kernel, so…


----------

