티스토리 뷰

DevOps

certbot 인증서 삭제 방법

Grand_J 2024. 7. 24. 11:09
반응형

certbot 인증서 삭제 방법

# 인증서 조회를 통해 삭제할 인증서 내용 찾기
$ sudo certbot certificates

Saving debug log to /var/log/letsencrypt/letsencrypt.log
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: test.xxx.kr
    Serial Number: 4bdf9b5c27e81617c68b3aece89a4ff8689
    Key Type: ECDSA
    Domains: test.xxx.kr
    Expiry Date: 2024-09-11 00:14:38+00:00 (VALID: 48 days)
    Certificate Path: /etc/letsencrypt/live/test.xxx.kr/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/test.xxx.kr/privkey.pem
  Certificate Name: test.xxx.com
    Serial Number: 457b9624f929c1725f38500e4f00baf660b
    Key Type: ECDSA
    Domains: test.xxx.com
    Expiry Date: 2024-09-10 06:04:27+00:00 (VALID: 48 days)
    Certificate Path: /etc/letsencrypt/live/test.xxx.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/test.xxx.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

# Certificate Path 인증서 삭제 (Y를 계속 누르면 됨)
$ sudo certbot revoke --cert-path /etc/letsencrypt/live/test.xxx.kr/fullchain.pem

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you like to delete the certificate(s) you just revoked, along with all
earlier and later versions of the certificate?
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es (recommended)/(N)o: y

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

  * test.xxx.kr

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 test.xxx.kr.
Congratulations! You have successfully revoked the certificate that was located at /etc/letsencrypt/live/test.xxx.kr/fullchain.pem.

# 인증서 명으로 삭제 (Y를 계속 누르면 됨)
$ sudo certbot delete --cert-name test.xxx.kr

# 삭제 확인
$ sudo certbot certificates

Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: test.xxx.com
    Serial Number: 457b9624f929c1725f38500e4f00baf660b
    Key Type: ECDSA
    Domains: test.xxx.com
    Expiry Date: 2024-09-10 06:04:27+00:00 (VALID: 48 days)
    Certificate Path: /etc/letsencrypt/live/test.xxx.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/test.xxx.com/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

 

 

반응형