顯示具有 SSL 標籤的文章。 顯示所有文章
顯示具有 SSL 標籤的文章。 顯示所有文章

2023/10/27

透過CertBot取得AliCloud SSL憑證

要先去AliCloud申請AliyunDNSFullAccess權限


sudo apt update -y
sudo apt install snapd -y
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo snap install certbot-dns-aliyun
sudo snap set certbot trust-plugin-with-root=ok
sudo snap connect certbot:plugin certbot-dns-aliyun

# 將AliCloud DNS API and Secret 寫入到alicloud.ini
sudo echo "dns_aliyun_access_key = apikey" > /etc/letsencrypt/alicloud.ini
sudo echo "dns_aliyun_access_key_secret = secret" >> /etc/letsencrypt/alicloud.ini

sudo chmod 600 /etc/letsencrypt/alicloud.ini
sudo certbot certonly --authenticator=dns-aliyun --dns-aliyun-credentials='/etc/letsencrypt/alicloud.ini' -d "domain"

參考資料:
https://github.com/tengattack/certbot-dns-aliyun

2023/05/12

Ubuntu 22.04 LTS Certbot 使用 CloudFlare 申請全域的 Let's Encrypt憑證

先輸入以下命令安裝套件
# Install CertBot
sudo apt update -y
sudo apt install snapd -y
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo apt install python-is-python3 python3-certbot-dns-cloudflare -y
進到CloudFlare所要取得SSL的Domain頁面,點擊Get your API token 編輯cf.ini
點擊Create Token

點擊Get started,啟用下列Pemission和選取要設定的Domain,點擊Continue to summary就會得到Token

2021/12/11

CentOS 7.7 7.8 8.1 Install CertBot get SSL cert

安裝
yum install -y epel-release snapd
systemctl enable --now snapd.socket
ln -s /var/lib/snapd/snap /snap
snap install core && snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
certbot --nginx
systemctl restart nginx
定時腳本
crontab -e
0 0 1 */1 * certbot renew
10 0 1 */1 * systemctl restart nginx
systemctl start crond.service
systemctl enable crond.service