이 질문은 리눅스에 적합하다 acl. OS를 밝히지 않았으므로 Linux를 다음과 같이 가정합니다. 다음은 예제 세션입니다.
정말 좋은 acl튜토리얼을 모르지만 http://www.vanemery.com/Linux/ACL/linux-acl.html 보다 더 나빠질 수 있습니다 .
기본값 acl은 로컬 umask처럼 작동합니다. 적어도 Linux에서는 umask가 전체적으로 적용되므로 이것이 로컬 umask의 효과를 얻는 유일한 방법입니다. 어떤 이유로 이것은 조금 알려진 기능입니다. 그물은 로컬 umask 재정의에 대해 묻는 사람들로 가득 차 있지만 거의 아무도 사용을 생각하지 않는 것 같습니다 acl.
또한 acl지원을 받고있는 파티션을 마운트해야합니다 ( 예 :
/dev/mapper/debian-acl /mnt/acl ext3 defaults,acl 0 2
세션은 다음과 같습니다.
/mnt/acl$ mkdir foo
/mnt/acl$ getfacl foo
# file: foo
# owner: faheem
# group: faheem
user::rwx
group::r-x
other::r-x
의 그룹으로 설정 foo될 수를 staff, 그룹 및 사용자의 ACL 설정 foo에를 rwx.
/mnt/acl$ chgrp staff foo
/mnt/acl$ setfacl -R -m u::rwx,g::rwx foo
/mnt/acl$ getfacl foo
# file: foo
# owner: faheem
# group: staff
user::rwx
group::rwx
other::r-x
사용자 및 그룹의 기본 acl도 설정하십시오 rwx. 파일 및 디렉토리가 상속하는 권한을 정의합니다 foo. 따라서 foo 아래에 생성 된 모든 파일과 디렉토리에는 그룹 권한이 rw있습니다.
/mnt/acl$ setfacl -d --set u::rwx,g::rwx,o::- foo
/mnt/acl$ getfacl foo
# file: foo
# owner: faheem
# group: staff
user::rwx
group::rwx
other::r-x
default:user::rwx
default:group::rwx
default:other::---
이제 foo사용자 faheem및 로 일부 파일을 만듭니다 john.
/mnt/acl$ cd foo
/mnt/acl/foo$ touch bar
# switch to user john for this next command.
/mnt/acl/foo$ touch baz
파일을 나열하십시오. 소유 한 faheem파일과 소유 한 파일은 모두 john그룹 권한으로 생성됩니다 rw.
/mnt/acl/foo$ ls -la
total 3
drwxrwxr-x+ 2 faheem staff 1024 May 9 01:22 .
drwxr-xr-x 4 faheem faheem 1024 May 9 01:20 ..
-rw-rw---- 1 faheem faheem 0 May 9 01:20 bar
-rw-rw---- 1 john john 0 May 9 01:22 baz