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
You can do this with a private key. Generate a decrypted key file to replace the original key file.
Then modify the configuration file
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.