• 跳至主要導覽
  • 跳至主要內容
  • 跳至主要資訊欄
Office 指南

Office 指南

辦公室工作實用教學

  • Excel
  • Word
  • PowerPoint
  • Windows
  • PowerShell
  • R

Certbot 刪除 Let’s Encrypt 頒發的網域 SSL 憑證教學與範例

介紹如何使用 certbot 指令刪除由 Let’s Encrypt 頒發的網域 SSL 憑證。


在使用 certbot 設定好網域的 SSL 憑證之後,系統就會自動定期更新憑證,而當網站要下線時,也要記得以 certbot 指令將對應的網域 SSL 憑證刪除,以下是操作步驟。

確認網域名稱

所有透過 certbot 取得 SSL 憑證的網域,都會有對應的設定檔案放在 /etc/letsencrypt/renewal/ 目錄下,所以從目錄中的設定檔就可以查看目前所有的網域名稱:

# 列出 certbot 所有網域設定檔
ls /etc/letsencrypt/renewal/
officeguide.cc.conf
another.domain.tw.conf

只要將設定檔名稱結尾的 .conf 去掉,就是對應的網域名稱,例如 another.domain.tw.conf 設定檔就對應 another.domain.tw 這個網域。

撤銷網域 SSL 憑證

使用 certbot 搭配 revoke 指令撤銷網域 SSL 憑證,憑證的位置通常放在 /etc/letsencrypt/live/網域名稱/cert.pem,例如撤銷 my.domain.tw 網域 SSL 憑證:

# 撤銷 my.domain.tw 網域 SSL 憑證
certbot revoke --cert-path /etc/letsencrypt/live/my.domain.tw/cert.pem

刪除網域 SSL 憑證與相關設定

將憑證撤銷之後,就可以使用 certbot 搭配 delete 指令刪除沒用的網域 SSL 憑證與相關設定:

# 刪除 my.domain.tw 網域 SSL 憑證與相關設定
sudo certbot delete --cert-name my.domain.tw

參考資料:BrilliantCode.net

分類:Linux 標籤:資訊安全

主要資訊欄

搜尋

近期文章

  • Python 使用 PyAutoGUI 自動操作滑鼠與鍵盤
  • Ubuntu Linux 以 WireGuard 架設 VPN 伺服器教學與範例
  • Linux 網路設定 ip 指令用法教學與範例
  • Windows 使用 TPM 虛擬智慧卡保護 SSH 金鑰教學與範例
  • Linux 以 Shamir’s Secret Sharing 分割保存金鑰教學與範例
  • Linux 以 Cryptsetup、LUKS 加密 USB 隨身碟教學與範例
  • Linux 以 Cryptsetup 與 LUKS 加密磁碟教學與範例
  • Linux 使用 age 簡潔的加密、解密工具使用教學與範例

推薦網站

  • Udemy 線上教學課程
  • Coursera 線上教學課程

關注本站

  • 電子郵件
  • Facebook

公益

  • 家扶基金會
  • 台灣世界展望會
  • Yahoo 奇摩公益
  • igiving 公益網
  • 兒福聯盟

Copyright © 2021 · Office Guide