심볼릭 링크를 통한 라이센스

심볼릭 링크를 통한 라이센스

사용자(33)는 web.{crt,key} 파일을 읽을 수 없습니다. 모든 링크를 통해 권한을 부여해야 합니까, 아니면 이를 수행하는 현명한 방법이 있습니까?

# ll /mnt/efs/cert
total 20
-rw-r--r-- 1 33 tape 1237 Oct  9 14:30 dag.crt
-rw-r--r-- 1 33 tape 1704 Oct  9 14:30 dag.pem
drwxr-xr-x 2 33 tape 6144 Dec  7  2018 ldap
lrwxrwxrwx 1 33 tape   74 Oct 14 12:13 web.crt -> /etc/letsencrypt/live/domain/fullchain.pem
lrwxrwxrwx 1 33 tape   72 Oct 14 12:13 web.key -> /etc/letsencrypt/live/domain/privkey.pem
# ll /etc/letsencrypt/live/domain/
total 4
lrwxrwxrwx 1 root root  62 Oct 14 12:01 cert.pem -> ../../archive/domain/cert1.pem
lrwxrwxrwx 1 root root  63 Oct 14 12:01 chain.pem -> ../../archive/domain/chain1.pem
lrwxrwxrwx 1 root root  67 Oct 14 12:01 fullchain.pem -> ../../archive/domain/fullchain1.pem
lrwxrwxrwx 1 root root  65 Oct 14 12:01 privkey.pem -> ../../archive/domain/privkey1.pem
-rw-r--r-- 1 root root 692 Oct 14 12:01 README
# ll /etc/letsencrypt/archive/domain/
total 16
-rw-r--r-- 1 root root 1972 Oct 14 12:01 cert1.pem
-rw-r--r-- 1 root root 1647 Oct 14 12:01 chain1.pem
-rw-r--r-- 1 root root 3619 Oct 14 12:01 fullchain1.pem
-rw------- 1 root root 1708 Oct 14 12:01 privkey1.pem

답변1

댓글을 달고 싶은데 평판 포인트 50이 필요합니다.

내 정보로는 모든 링크가 가리키는 최종 파일이 접근하려는 파일이기 때문에 해당 파일에 대한 접근권한이 중요합니다. privkey1.pemin 의 액세스 권한은 /etc/letsencrypt/archive/domain/root 이외의 사용자에게는 읽기 액세스를 허용하지 않으므로 root root이외의 사용자는 액세스할 수 없습니다.

다른 사용자에게 읽기 액세스 권한을 부여하려면 해당 권한을 "644"로 변경해야 합니다.

chmod 0644 /etc/letsencrypt/archive/domain/privkey1.pem

답변2

먼저 사용자(33)가 입력 그룹에 속해 있는지 확인해야 합니다. 테이프 그룹이 없으면 새로 만들어야 합니다.

입력된 그룹에 속한 사용자를 표시하려면 다음 명령을 사용할 수 있습니다.

sudo groups tape

입력 그룹에 사용자(33)를 추가하려면 다음 명령을 사용할 수 있습니다.

sudo gpasswd -a $(getent passwd 33|cut -d: -f1) type

그런 다음 각 파일을 읽고 쓸 수 있게 만들려면 다음 명령을 사용할 수 있습니다.

for d in /mnt/efs/cert /etc/letsencrypt/live/domain/ /etc/letsencrypt/archive/domain/; for f in $(ls $d);do chmod g+rw $f;done ;done

관련 정보