centos命令certbot申请免费ssl证书

准备epel源
yum -y install epel
直接yum安装
yum -y install certbot
申请证书,期间需要去dns解析页面配置TXT解析
certbot certonly --email 532733681@qq.com --server https://acme-v02.api.letsencrypt.org/directory --agree-tos --manual --preferred-challenges=dns -d *.xx.com

查看生成的公钥私钥
ll /etc/letsencrypt/live/xx.com/fullchain.pem #公钥
ll /etc/letsencrypt/live/xx.com/privkey.pem #私钥

证书续期
certbot renew

注意:如果按照报错package not found,需要重新找epel源
yum -y install yum-utils
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum-config-manager --enable rhui-REGION-rhel-server-extras rhui-REGION-rhel-server-optional
yum install certbot

借鉴https://qa.1r1g.com/sf/ask/3748180551/
借鉴https://www.zhihu.com/question/484431835/answer/3163134184?utm_id=0

posted @ 2023-12-06 16:33  A学无止境A  阅读(304)  评论(0编辑  收藏  举报