Solve the problem that Nginx requires two passwords when updating Nginx due to the installation of SSL certificates in HTTPS. nginxssl
1: Open the terminal, enter your ssl Certificate directory, and find the key as shown in the following example:
[root@localhost ~]# ll cd /etc/nginx/-rw-r--r-- 1 root root 1009 2017/12/18 15:54:54 server.crt-rw-r--r-- 1 root root 729 2017/12/18 15:54:32 server.csr-rw-r--r-- 1 root root 887 2017/12/18 20:33:01 server.key-rw-r--r-- 1 root root 963 2017/12/18 15:52:17 server.key.bk-rw-r--r-- 1 root root 887 2017/12/18 15:54:47 server_nopwd.key
2: You can see the Certificate file of. crt and the private key of. key. We need to use xxxxx. key and execute the command:
Openssl rsa-in xxxxx. key-out newxxxxx. key. unsecure # xxxxx. key is your private key-out and a new key named newxxxx is output.
3: At this time, we can see that the directory has a newxxxxx. key. unsecure password-less key, and we back up the original key:
Mv xxxxx. key./xxxxx. key. bk # back up the original key
4: Rename the key without a password as the original key, so that we do not need to modify the nginx configuration file.
Mv newxxxxx. key. unsecure./xxxxx. key # rename the generated key to the previous key.
5: Okay. Now we restart nginx.
service nginx restart
6: no password is required to restart the Nginx server ~