Cerbot - 安装和手动申请&更新HTTPS证书

官方文档: https://eff-certbot.readthedocs.io/en/stable/install.html

Step 1:安装Cerbot

apt update && apt install certbot

Step 2:使用标准模式申请证书

certbot certonly --standalone

示例:标准模式申请证书

我们将使用demo@example.comdemo.example.com作为演示,当您在下面高亮内容看到demo@example.comdemo.example.com 时,请根据实际情况自行更改,其他高亮部分,请按照高亮内容填写

root@s2:~# certbot certonly --standalone
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Enter email address (used for urgent renewal and security notices) (Enter 'c' to cancel): 
demo@example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You mustagree in order to register with the ACME server. Do you agree?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: 
Y 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing, once your first certificate is successfully issued, toshare your email address with the Electronic Frontier Foundation, a foundingpartner of the Let's Encrypt project and the non-profit organization thatdevelops Certbot? 
We'd like to send you email about our work encrypting the web,EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: 
N
Account registered.Please enter the domain name(s) you would like on your certificate (comma and/orspace separated) (Enter 'c' to cancel):
demo.example.com

 Requesting a certificate for demo@example.com 
 Successfully received certificate.
 Certificate is saved at: /etc/letsencrypt/live/demo@example.com/fullchain.pem
 Key is saved at:         /etc/letsencrypt/live/demo@example.com/privkey.pem
 This certificate expires on 2022-06-22.These files will be updated when the certificate renews.Certbot has set up a scheduled task to automatically renew this certificate in the background.
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  If you like Certbot, please consider supporting our work by: 
  * Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate 
  * Donating to EFF: https://eff.org/donate-le
  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

示例:通过帐户密钥或证书私钥吊销

默认情况下,Certbot 将尝试使用您的 ACME 帐户密钥吊销证书.如果证书是从 同一个 ACME 帐户,吊销将成功.

如果您拥有要吊销的证书的相应私钥文件,请使用 从任何 ACME 帐户吊销.

我们将使用demo@example.com作为演示,当您在下内容看到demo@example.com时,请根据实际情况自行更改路径.

certbot revoke --cert-path /etc/letsencrypt/live/demo@example.com/cert.pem --key-path /etc/letsencrypt/live/demo@example.com/privkey.pem