왜 심볼릭 링크 디렉토리에 접근할 수 없나요?

왜 심볼릭 링크 디렉토리에 접근할 수 없나요?

내 .thunderbird 디렉토리를 SD 카드의 실제 디렉토리에 (소프트) 연결하고 싶습니다.

그러므로,

(xenial)florian@localhost:~$ ls -la /var/host/media/removable/SD\ Card/.thunderbird/
total 24
drwx------.  5 florian florian 4096 May 21 09:23 .
drwxrwxrwx. 10 florian florian 4096 Mar  4 22:42 ..
drwx------.  3 florian florian 4096 Apr  6 13:43 Crash Reports
drwx------. 10 florian florian 4096 May  7 20:39 kps6nx9x.default
drwx------.  2 florian florian 4096 Nov  8  2018 Pending Pings
-rw-rw-r--.  1 florian florian   94 Nov 14  2013 profiles.ini
(xenial)florian@localhost:~$ ls -la .thunderbird 
lrwxrwxrwx. 1 florian florian 47 May 21 09:32 .thunderbird -> /var/host/media/removable/SD Card/.thunderbird/

권한을 /var/host/media/removable/SD 카드로 변경했습니다.

drwxrwxrwx.  15 root root  4096 Sep 15  2018 var
drwxrwxrwx.  9 root root     4096 Sep 15  2018 host
drwxrwxrwt. 5 root    root     100 May 20 21:22 media
drwxrwxrwx. 10 florian florian 4096 Mar  4 22:42 SD Card

그러나 그럼에도 불구하고,

(xenial)florian@localhost:~$ ls .thunderbird 
ls: cannot access '.thunderbird': Permission denied

여기서 무슨 일이 일어나고 있는 걸까요?

답변1

달리기 sudo chmod o-t /var/host/media.

인용하다:https://sysctl-explorer.net/fs/protected_symlinks/

귀하의 권한 문제는 다음과 같습니다.

drwxrwxrwt. 5 root    root     100 May 20 21:22 media

끝에 있는 것은 t디렉터리가 고정되어 있음을 나타냅니다.

링크된 웹페이지에서 인용:

"1"로 설정하면, 누구나 쓸 수 있는 고정 디렉터리 외부에 있거나, 심볼릭 링크와 팔로어의 uid가 일치하거나, ​​디렉터리 소유자가 심볼릭 링크의 소유자와 일치하는 경우에만 심볼릭 링크를 따라갈 수 있습니다.


여기서 하고 싶지 않은 일을 지적하기 위한 또 다른 사항은 다음과 같습니다.

권한을 /var/host/media/removable/SD 카드로 변경했습니다.

이는 좋은 생각이 아닙니다. 이제 모든 사람이 NET에서 수행하던 작업을 읽고, 쓰고, 실행할 수 있습니다 /var. 이전 상태로 다시 변경하는 것이 가장 좋습니다(예: 심각한 경우 백업 복원 또는 재설치).

관련 정보