'Error opening CA private key when Create the intermediate pair

I follow this tutorial to Create the root pair and Create the intermediate pair.

Create the root pair is fine, but when i try to Create the intermediate pair it's error at this line:

openssl ca -config openssl.cnf -extensions v3_intermediate_ca \
      -days 3650 -notext -md sha256 \
      -in intermediate/csr/intermediate.csr.pem \
      -out intermediate/certs/intermediate.cert.pem

with error is:

Error opening CA private key /root/ca/private/ca.key.pem
140382210524824:error:02001002:system library:fopen:No such file or directory:bss_file.c:398:fopen('/root/ca/private/ca.key.pem','r')
140382210524824:error:20074002:BIO routines:FILE_CTRL:system lib:bss_file.c:400:
unable to load CA private key

I follow step by step and check so many time but really don't know why. What am i missing? Someone know please give me some advice



Solution 1:[1]

I ran into same problem on ubuntu. Did following steps to resolve it:

Copy openssl.cnf to local directory and did the following changes. (Note doble slashes)

fopen_dir = //home/gl-448//vaayu-dl//keys//vaayu_ca//

private_key = $fopen_dir//private//cakey.pem

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1