Solve the problem that Nginx requires two passwords when updating Nginx due to the installation of SSL certificates in HTTPS. nginxssl

Source: Internet
Author: User

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 ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.