使用Certbot自动生成和更新证书

2023-12-21  本文已影响0人  终可见丶
  1. 安装certbot
    apt install certbot

  2. 安装cerbot-aliyun-dns插件(还有多种可选)
    地址:https://github.com/tengattack/certbot-dns-aliyun

  3. 创建阿里云的子账号并仅授权域名管理权限
    阿里云控制台搜索访问控制,新建用户


    进入访问控制

    添加权限时候选择管理云解析权限


    授权云解析权限
  4. 保存key和secret
    编辑文件vim /etc/letseccrypt/dns-aliyun/credentials.ini复制粘贴以下内容,把key和secret改成自己的

dns_aliyun_access_key = aliyun_key
dns_aliyun_access_key_secret = aliyun_secret

按下ESC,:wq保存退出

  1. 申请证书
    certbot certonly -d "xxx.example.com" --authenticator=dns-aliyun --dns-aliyun-credentials='/etc/letsencrypt/dns-aliyun/credentials.ini'
    输入邮箱,同意协议,第二个接收广告信息的邮件询问可以拒绝
    申请证书截图
上一篇 下一篇

猜你喜欢

热点阅读