用 Certbot 申请免费 TLS 证书
为域名申请并自动续期 Let's Encrypt 证书。
运行 sudo certbot certonly --standalone -d example.com 申请证书。
01命令
命令
$ sudo certbot certonly --standalone -d example.com02作用说明
Certbot 通过 standalone(临时起一个 Web 服务)或 --nginx/--apache 验证域名控制权,把证书保存在 /etc/letsencrypt 并安装续期定时任务。证书有效期 90 天,会自动续期。
03风险
!注意: standalone 模式需要 80 端口可达,并会临时停用占用该端口的已有 Web 服务。
04撤销
✓无需撤销——该命令不会改变持久状态。
05来源
- Certbot依据: Debian packages Certbot, the EFF client for Let's Encrypt certificates.
- Debian package: certbot依据: Debian packages Certbot, the EFF client for Let's Encrypt certificates.
最后验证: 2026-09-22 · 分类: 安全与隐私