Reconfiguring gpg to use the non-blocking pseudorandom number generator, which would be most unwise (though see below),
Your choices, in order of increasing satisfactoriness, are Key generation requires a lot of very high-quality random numbers without the activity of the user to provide high-quality randomness to the computer, the entropy pool is being exhausted by generation, and the generation process just hangs, waiting for the pool to refill. It is likely that you are running out of entropy. What am I missing? How to generate the key without any kind of user interaction? The foo.pub/foo.sec files are generated in home dir, but are empty. In ~/.gnupg/gpg.conf there is no mention about agent, and I have no idea what it's trying to do. When I check, in the mean time, ps tree for this user, I see: USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND # Do a commit here, so that we can later print 'done' :-) Tail -n +4 /usr/share/gnupg2/gpg-conf.skel >. I found in method to generate gpg keys without user interaction, but it doesn't seem to work.