Let's encrypt常用指令

在ubuntu使用certbot現在非常簡單直接用apt install即可

1
2
apt update
apt install certbot

可以使用cron設定自動檢查更新證書在_etc_crontab中加入以下內容並重啟cron服務

1
2
00 1    * * 1   root    certbot renew
00 2 * * * root service nginx reload

使用cerbot在nginx下新增域名證書

1
certbot certonly --webroot --webroot-path=/usr/share/nginx/html -d 域名

Letsencrypt第一次設定後,如果後續還需要更改通知信箱可以使用以下指令

1
certbot update_account --email yourname@example.com