小编use*_*858的帖子

如何完全删除 certbot 创建的 SSL 证书?

我将 Ubuntu 16.04 与 Nginx 一起使用,并且我已经在我的操作系统(Ubuntu 16.04)上安装了 Nginx Certbot:

apt-get update -y
add-apt-repository ppa:certbot/certbot -y
apt-get update -y
apt-get upgrade python-certbot-nginx -y
Run Code Online (Sandbox Code Playgroud)

我设置了 Nginx 变量:

s_a="/etc/nginx/sites-available"
s_e="/etc/nginx/sites-available"
Run Code Online (Sandbox Code Playgroud)

我根据这些变量创建了一个应用程序配置:

sed "s/\${domain}/${1}/g" "~/${repo}/template_nginx_app" > "${s_a}/${domain}.conf"
ln -sf ${s_a}/${domain}.conf ${s_e}
Run Code Online (Sandbox Code Playgroud)

我基于 app conf 用 Certbot 创建了一个对应的 SSL 证书,这样:

certbot --nginx -d ${domain} -d www.${domain}
Run Code Online (Sandbox Code Playgroud)

在某些情况下,SSL 证书的创建方式不正确,只需在进行一些配置后重新开始即可。

我怎样才能完全删除 SSL 证书(除了删除${domain}.conf也由 Certbot 编辑/重新配置的应用程序配置)?

有没有直接从 Certbot 执行此操作的快速方法?我的愿望是应用程序配置文件和证书都不会留下任何残留物。

这可能是个好方法:

rm ${s_a}/${domain}.conf && rm ${s_e}/${domain}.conf
rm -rf /etc/letsencrypt/{live,renewal,archive}/{${DOMAIN},${DOMAIN}.conf}
Run Code Online (Sandbox Code Playgroud)

ssl configuration nginx bash certbot

12
推荐指数
3
解决办法
2万
查看次数

标签 统计

bash ×1

certbot ×1

configuration ×1

nginx ×1

ssl ×1