Let’s Encrypt 발급 증명서 삭제 방법

Linux

이 글에서는 Let’s Encrypt로 발급한 필요없는 증명서를 rm명령 또는 certbot명령으로 삭제하는 방법을 설명합니다.

증명서 장소 확인하기

Let’s Encrypt로 발급한 증명서는 다음과 같이 live, renewal, archive의 세 장소에 보관되어 있습니다.

$ sudo ls /etc/letsencrypt/live/
tech.zinnunkebi.com  tokyo.zinnunkebi.com  www2.zinnunkebi.com
$ sudo ls /etc/letsencrypt/renewal/
tech.zinnunkebi.com.conf  tokyo.zinnunkebi.com.conf  www2.zinnunkebi.com.conf
$ sudo ls /etc/letsencrypt/archive/
tech.zinnunkebi.com  tokyo.zinnunkebi.com  www2.zinnunkebi.com

방법1)디렉토리 삭제 하기

live, renewal, archive의 세 장소에 보관된 증명서 디렉토리, 파일을 rm명령으로 직접 삭제합니다.

$ sudo rm -rf /etc/letsencrypt/live/www2.zinnunkebi.com
$ sudo rm -rf /etc/letsencrypt/renewal/www2.zinnunkebi.com.conf
$ sudo rm -rf /etc/letsencrypt/archive/www2.zinnunkebi.com

방법2)certbot명령으로 증명서 삭제하기

다음과 같이 대화형 메뉴가 표시되 삭제하고자 하는 증명서를 선택하면 해당하는 live, renewal, archive의 세 장소에 보관된 증명서 디렉토리, 파일가 삭제됩니다..

$ sudo certbot delete
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which certificate(s) would you like to delete?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: tech.zinnunkebi.com
2: tokyo.zinnunkebi.com
3: www2.zinnunkebi.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter 'c' to cancel): 3

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
The following certificate(s) are selected for deletion:

  * www2.zinnunkebi.com

WARNING: Before continuing, ensure that the listed certificates are not being
used by any installed server software (e.g. Apache, nginx, mail servers).
Deleting a certificate that is still being used will cause the server software
to stop working. See https://certbot.org/deleting-certs for information on
deleting certificates safely.

Are you sure you want to delete the above certificate(s)?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: y
Deleted all files relating to certificate www2.zinnunkebi.com.

Apache 서버의 SSL 설정 변경

다음은 Apache 서버의 SSL 설정의 일부입니다. 이 행은 SSL 암호화 통신을 수행하는 데 필요한 인증서 파일과 키를 지정합니다. /etc/httpd/conf.d/ssl.conf에서 제거합니다.

SSLCertificateFile /etc/letsencrypt/live/www2.sadari.co.jp/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/www2.sadari.co.jp/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/www2.sadari.co.jp/chain.pem

댓글

제목과 URL을 복사했습니다