SSH not starting, PRNG is not seeded

I’m on ubuntu 16.04.7 LTS, enabled for ESM (Extended Security Maintenance).

I upgraded packages yesterday, and since then, ssh.service is not starting anymore. Error is “PRNG is not seeded”.

I do have /dev/random and /dev/urandom and they do generate random numbers.

I also installed haveged for larger entropy. I checked cat /proc/sys/kernel/random/entropy_avail, and I get values over 2000.

In my home directory, .rnd is present, and it has a size of 1024 bytes.

I made the update through the ssh terminal, so it worked before. After that though, the ssh.service did not start anymore and I can access only through the browser recovery console.

Any ideas what else should I do to have ssh again?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

Hi @ovim,

I’m just going to throw some random fixers for such issues and let me know if you’ve tried them or if not, will you try them.

So first, as you’ve mentioned let’s see the /dev/random and /dev/urandom part.

Check permissions on random numbers generators, the “others” must have “read” access to these devices:

# ls -l /dev/random /dev/urandom
crw-r--r-- 1 root system 39, 0 Dec 28 10:48 /dev/random
crw-r--r-- 1 root system 39, 1 Dec 28 10:48 /dev/urandom

If the permissions are different, you can change them as follows:

chmod o+r /dev/random /dev/urandom

Then restart your SSHD service

stopsrc -s sshd
startsrc -s sshd

If you are still getting the same issue, try removing urandom and random and creating them again.

stopsrc -s sshd
rm -rf /dev/random
rm -rf /dev/urandom
mknod /dev/random c 39 0
mknod /dev/urandom c 39 1
randomctl -l
ls -lad /dev/random /dev/urandom
startsrc -s sshd