openssl - How to configure nginx to configure SSL security certificate and restart without entering password
阿神
阿神 2017-05-16 17:30:14
0
2
938

Today I configured an SSL security certificate for Nginx

ssl on; ssl_certificate /home/cert/server.crt; ssl_certificate_key /home/cert/server.key;

Then the password will be required when restarting and reloading. . .

# /usr/local/nginx/sbin/nginx -s reload Enter PEM pass phrase:

But I have a script that needs to run reload every day, and the password input function cannot be implemented
Is there any way to automatically enter the password?

P.S. I tried the pipe, but nginx couldn’t receive it

阿神
阿神

闭关修行中......

reply all (2)
给我你的怀抱

You can do this with a private key. Generate a decrypted key file to replace the original key file.

openssl rsa -in server.key -out server.key.unsecure

Then modify the configuration file

ssl on; ssl_certificate /home/cert/server.crt; ssl_certificate_key /home/cert/server.key.unsecure;

This way you don’t have to enter your password

    習慣沉默

    Try the expect command, which can be used to enter the password. You can refer to the expect automatic ssh script.

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!