openssl unable to write random state

openssl genrsa -out test.pem 1024 -rand $HOME/httpdocs/cert/.rnd
Generating RSA private key, 1024 bit long modulus
…………………….++++++
…………………..++++++
unable to write ‘random state’
e is 65537 (0x10001)

Causing non-random keys to be generated
This is because openssl tries to create a .rnd file in the users home directory by default to create the random file.  The home directory in plesk is owned by root so the user does not have permission to write the file.  You can specify a new file by:

cd httpdocs/cert
touch .rnd
export RANDFILE=”/var/www/vhosts/c4fc.net/httpdocs/cert/.rnd

You can leave a response, or trackback from your own site.

One Response to “openssl unable to write random state”

  1. Thank you, I left out the ” before /var/www, this solved my problem.

Leave a Reply