PGP: Not enough random bytes available. Please do some other work to give the OS a chance to collect more entropy

纵饮孤独 提交于 2019-11-29 23:26:44
zdenekca

Run the following:

find / > /dev/null

That helped me quickly to complete my key generation.

Try installing haveged, this is a daemon, which helps the system with generating random numbers for your key.

sudo aptitude install haveged

Step 1 Run on a shell first and let it run ls / -R

Step 2 Now try to generate the key it will be done

for more info follow http://alsdias.blogspot.jp/2012/11/gpg-not-enough-random-bytes-available.html

I've tried different tricks while watching the /proc/sys/kernel/random/entropy_avail value. But trying to make an MD5 hash of an entire disk really gave my system entropy on steroids without installing extra packages.

find /dev/disk/by-uuid/ -type l | xargs md5sum

Trying installing rngd. If your CPU if reasonably modern it will have a hardware random number generator built in, and rngd will use this to generate enough entropy.

Watch out for people telling you to run rngd -r /dev/urandom. While this will get rid of your error, it does it by faking entropy and leads to insecure keys.

Move your mouse around for 30s or so in a new tab, and then try the following:

base64 /dev/urandom

This will start printing out random code to the screen. In a few mins, sufficient amount of psuedo-random data would have been generated to complete key generation.

This is what is the solution I found to it

I had to do gpg --gen-key --no-use-agent

after that in an another terminal I fired up cat /dev/random

This fortunately for me worked at the end :)

try running (in another terminal tab) $cat /proc/sys/kernel/random/entropy_avail on command line, it it returns less than 100-200, then something is wrong, install rng-tools $sudo apt-get install rng-tools

That should have fixed this issue, check the previous tab and you have the key

I did apt-get install libreoffice and apt-get remove libreoffice* a couple times. That did the trick. Pick some other big fat program for yourself to use.

I try to solve. I use Fedora 25 with gpg1 and gpg2 have installed as standar for mechine.

Declare about problem.
If you use Fedora 25 OS, i see gpg confict wiht ownertrust (please remove old trustdb.gpg) at otrust.tmp. and must create new trustdb.gpg.

Please follow this command at your terminal command. (not have to root mode). You may try to re-create the trustdb using the commands:

cd ~/.gnupg

gpg2 --export-ownertrust > otrust.tmp
rm trustdb.gpg
gpg2 --import-ownertrust < otrust.tmp

then you can use

gpg --list-secret-keys --keyid-format LONG
then export as asci format.
gpg --armor --export "type-here-your-secKEY"

at the end of gpg message u see parentheses like (125 byte remaining)

the gpg needs some random bytes that u must enter.so press Ctrl-z and type a random set of x(number in parentheses) characters not necessarily meaningful like: dfkheuhasdkjvdaiugekjfhflsdfhuhggskdfjhsjdf

then do it 2 or 3 times, GPG shows an answer that tells u it's done key generating:)

You can install daemons to gather entropy. This command would install two such daemons:

sudo apt-get install haveged rng-tools

I would personally perfer haveged (because of the people who have created it) over rng-tools. But, I prefer to install both since they quite different.

Running $ sudo rngd -r /dev/urandom

Then running $ gpg --user-agent

and $ ps -ef | egrep rngd (shows process number of rngd, e.g. 9999)

then $ sudo kill 9999

worked for me on my Ubuntu 13.04 system.

Just use another random maker under Ubuntu:

mv /dev/random /dev/chaos && ln -s /dev/urandom /dev/random

and retry your gpg command

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!