在 Debian 上,如果你是用 Let’s Encrypt + Certbot 申请的 SSL 证书(最常见情况),续期非常简单。下面分情况说明。
sudo certbot renew --dry-run
sudo certbot renew
Certbot 安装后会自动添加 systemd timer 或 cron:
systemctl status certbot.timer
sudo systemctl enable --now certbot.timer
Certbot 默认会在证书 剩余 < 30 天 时自动续期。
续期后需要让 Nginx 重新加载:
sudo nginx -t
sudo systemctl reload nginx
Certbot 一般会自动执行 reload,但手动确认更稳妥。
Debian 12+ 推荐 snap 安装:
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
续期命令一样:
sudo certbot renew
acme.sh --renew -d example.com
或自动续期(默认已配置 cron):
acme.sh --cron
Nginx 需手动 reload:
systemctl reload nginx
echo | openssl s_client -servername example.com -connect example.com:443 2>/dev/null | openssl x509 -noout -dates
如果你能告诉我:
我可以给你更精确的命令。