1.获取certbot-autoapi
wget https://dl.eff.org/certbot-auto
2.添加执行权限dom
chmod u+x certbot-auto
3.申请证书code
sudo ./certbot-auto --server https://acme-v02.api.letsencrypt.org/directory --manual --preferred-challenges dns-01 certonly -d "*.your-domain.com"
4.添加TXT记录
_acme-challenge.your-domain.com
记录值为:(生成的字符串)
server
5.可根据如下命令查询TXT记录是否生效dns
dig _acme-challenge.your-domain.com txt
6.证书生成成功后保存在 /etc/letsencrypt/live/your-domain.com/
中字符串
7.证书有效期为三个月,从新生成证书命令 certbot-auto renew
terminal