Question

SSH not starting, PRNG is not seeded

Posted December 27, 2021 103 views
Ubuntu 16.04

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?

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.

×
Submit an Answer
1 answer

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
  • hello,

    thanks for the reply.
    i tried those. i even removed packages and installed again. it still didn’t work. in the end, i upgraded to ubuntu 18 and now it seems to work ok.

    • Hi @ovim,

      Ah, I see well, as long as it works now.

      Additionally, I’ll recommend doing the jump to 20.04 as it’s EOL is not for another couple of years and as such it should be supported on a daily basis in terms of upgrades and other similar stuff