리눅스에서 openssl 명령어를 이용하여 키를 생성하는 과정에서 아래와 같은 메시지가 출력되는 경우가 있다.
unable to write 'random state'
위 에러 메시지에 대한 openssl.org 사이트의 설명은 아래와 같다.
2. Why do I get an "unable to write 'random state'" error message?
Sometimes the openssl command line utility does not abort with a "PRNG not seeded" error message, but complains that it is "unable to write 'random state'". This message refers to the default seeding file (.rnd). A possible reason is that no default filename is known because neither RANDFILE nor HOME is set. (Versions up to 0.9.6 used file ".rnd" in the current directory in this case, but this has changed with 0.9.6a.)
즉, 시딩 파일(.rnd) 이라는게 사용자의 홈계정에 존재하는데, 이 파일의 소유주가 루트나 기타 다른 계정일 경우에 발생할 여지가 있다고 한다. 아래의 명령어를 통해 소유를 변경하고 다시 시도하면 된다.
sudo chown user:user ~/.rnd