폴더 권한

폴더 권한

다음과 같은 디렉토리 구조가 있습니다.

  1. 폴더 1
    1.1 폴더 2
    1.1.1 폴더 3
    1.1.2 폴더 4
    1.1.3 파일 1

Folder2는 삭제할 수 없지만 하위 폴더(Folder3 및 4)와 file1은 읽고 수정하고 삭제할 수 있도록 특수 권한을 설정하는 방법은 무엇입니까?

미리 도움을 주셔서 감사합니다.

답변1

파일을 삭제하거나 이름을 바꾸려면 해당 디렉터리에 대한 쓰기 권한이 필요합니다. 소유자를 루트로 설정하고 Folder1의 권한을 읽기 전용으로 변경합니다.

chown root Folder1
chmod 755 Folder1

답변2

다음은 GNU chmod 문서에서 발췌한 것입니다:

RESTRICTED DELETION FLAG OR STICKY BIT

The  restricted  deletion  flag  or  sticky  bit is a single bit, whose
interpretation depends on the file type.  For directories, it  prevents
unprivileged  users  from  removing or renaming a file in the directory
unless they  own  the  file  or  the  directory;  this  is  called  the
restricted  deletion  flag  for the directory, and is commonly found on
world-writable directories like /tmp.

이는 Linux에만 해당될 수 있지만 chmod o+rwt디렉토리에서 이를 사용하여 위의 내용을 통해 해당 내용에 액세스할 수 있습니다. 이는 정확히 귀하가 원하는 것이 아닐 수도 있습니다. 콘텐츠를 모든 사용자가 수정할 수 있는지 아니면 콘텐츠를 만든 사용자만 수정할 수 있는지 언급하지 않았습니다.

관련 정보