letsencrypt 인증서에 대한 권한 거부 오류

letsencrypt 인증서에 대한 권한 거부 오류

이 오류는 권한 변경을 시도한 권한으로 인해 인증서를 읽을 수 없는 비둘기장에서 발생한 것입니다. 현재 644에 모든 것이 있습니다. 경로는 /etc/letsencrypt/archives파일 경로에 대한 링크일 뿐이므로 실제로 무슨 일이 일어나고 있는지 모르겠습니다. 링크의 권한이 대상에 어떤 영향을 미치는지 모르겠습니다.

mail dovecot: imap(example_user)<28542><mxY1sjPSlsxHvuNn>: 
 Panic: Settings check unexpectedly failed: ssl_client_ca_dir: 
 access(/etc/letsencrypt/live/mail.servicemouse.com) failed: Permission denied

답변1

두 디렉토리 모두에 대해 합리적인 권한을 설정해야 합니다.연결( /etc/letsencrypt/live)이고실제 파일( /etc/letsencrypt/archives). 그리고 새 파일에는 "보안" 권한이 부여되므로 인증서를 갱신할 때마다 문제를 수정하세요. 다음 스크립트는 내가 얼마 전에 사용한 것입니다.

#!/bin/bash

#use: certbot renew --post-hook /usr/local/bin/certbot-renew-fix-file-access.sh

chmod 0755 /etc/letsencrypt/
chmod 0711 /etc/letsencrypt/live/
chmod 0750 /etc/letsencrypt/live/example.com/
chmod 0711 /etc/letsencrypt/archive/
chmod 0750 /etc/letsencrypt/archive/example.com/
chmod 0640 /etc/letsencrypt/archive/example.com/{cert,chain,fullchain}*.pem
chmod 0640 /etc/letsencrypt/archive/example.com/privkey*.pem

chown root:root /etc/letsencrypt/
chown root:root /etc/letsencrypt/live/
chown root:mail /etc/letsencrypt/live/example.com/
chown root:root /etc/letsencrypt/archive/
chown root:mail /etc/letsencrypt/archive/example.com/
chown root:mail /etc/letsencrypt/archive/example.com/{cert,chain,fullchain}*.pem
chown root:mail /etc/letsencrypt/archive/example.com/privkey*.pem

/etc/init.d/postfix restart
/etc/init.d/cyrus restart
/etc/init.d/apache2 restart

호스트 이름, 서비스가 실행되지 않는 경우 그룹 이름, mail갱신 후 새 인증서를 선택해야 하는 서비스를 조정해야 합니다.

관련 정보