#vi /usr/src/kernels/2.6.xxxxxxversion/.config |
CONFIG_EXT2_FS_POSIX_ACL=y CONFIG_EXT3_FS_POSIX_ACL=y <---- As you can see we have built in support CONFIG_REISERFS_FS_POSIX_ACL=y CONFIG_JFS_POSIX_ACL=y CONFIG_FS_POSIX_ACL=y CONFIG_XFS_POSIX_ACL=y CONFIG_NFS_ACL=y CONFIG_NFSD_ACL=y CONFIG_NFS_ACL_SUPPORT=y |
# smbd -b | grep ACL HAVE_SYS_ACL_H HAVE_POSIX_ACLS |
# mount /dev/hda1 on / type ext3 (rw) /dev/hda3 on /data02 type ext3 (rw) |
# mount / -o remount,acl |
# mount /dev/hda1 on / type ext3 (rw,acl) /dev/hda3 on /data02 type ext3 (rw) |
setfacl options [user]or[group]:[uid][gid]or[username][groupname]:[Octalpermissions]or[rwxPermissions] ... filename |
setfacl -m u:root:rwx file or setfacl -m user:0:7 file |
[root ]# useradd test [root ]# cd /home/test [root ]# touch testfile ; echo hello > testfile [root ]# ls -l testfile -rw-r--r-- 1 root root 9 Apr 13 08:51 testfile |
[root ]# chmod 770 testfile [root ]# ls -l testfile -rwxrwx--- 1 root root 9 Apr 13 08:51 testfile |
[root ]# setfacl -m u:test:rwx testfile [root ]# ls -l testfile -rwxrwx---+ 1 root root 6 Apr 13 08:51 testfile |
[root ]# getfacl testfile # file: testfile # owner: root # group: root user::rwx user:test:rwx <----- user test has effective permissions of rwx group::rwx mask::rwx other::--- [root ]# cat testfile hello <----- remember we did this at the beginning [root ]# su test [test ]$ echo "test says hello" >> testfile [test ]$ cat testfile hello test says hello |
getfacl -R --skip-base / > /backup.acl |
# cd / # setfacl --restore=backup.acl |