pgp – Not enough random bytes available. Please do some other work to give the OS a chance to collect more

pgp – Not enough random bytes available. Please do some other work to give the OS a chance to collect more

I was working on getting a private key in order to sign a PPA and upload it to Launchpad. However, when I ran gpg –gen-key the server kept asking me to give it more entropy:

We need to generate a lot of random bytes. It is a good idea to perform
some other action (type on the keyboard, move the mouse, utilize the
disks) during the prime generation; this gives the random number
generator a better chance to gain enough entropy.

Not enough random bytes available. Please do some other work to give
the OS a chance to collect more entropy! (Need 276 more bytes)

At the beginning it wanted 256 bytes, then 248, then 216 I think but then it went back to the 240s and I was like, how am I supposed to ever get this done! The real problem is I am using an Ubuntu Server machine so the keyboard input is limited, no mouse movement, and I can’t like browse the Internet or play a video game to get this done. I found the following solution that got my key generated in no time:

You can start a new ssh session and execute this commands in it so you don’t have to quit your current pgp key generation process (and have to type all the settings again).

First make sure you have the following available and have the rights to it:

ls -l /dev/urandom

then execute rngd against it:

rngd -r /dev/urandom

You might get a message that reads:

The program ‘rngd’ is currently not installed. You can install it by typing:
apt-get install rng-tools

as it says, simply run: apt-get install rng-tools to get it installed and try again.

And that should do it!

Enhanced by Zemanta

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.