04 Extending Permissions ACLs
04 Extending Permissions ACLs
The kernel config file contains what is support whithin the kernel
# ls /boot/config-*
The dot "." at the end permission right in "ls -l" indicates ACL support
"+" symbol would indicates ACL configuration on file or dir
Get the ACL configured
$ getfacl part.sh
# file: part.sh
# owner: root
# group: root
user::rwx
group::r-x
other::r-x
$ mkdir test-acl
$ ls -ld test-acl/
drwxrwxr-x. 2 hux hux 6 23 juin 21:12 test-acl/
$ getfacl test-acl/
# file: test-acl/
# owner: hux
# group: hux
user::rwx
group::rwx
other::r-x
Options:
-m: modify ACL
d:o:-- (d = default, o = other, --- = (permission code)
This ACL is not for the dir but for new files created whithin the dir
"ls -l" will now the "+" symbol
$ ls -ld test-acl/
drwxrwxr-x+ 2 hux hux 32 23 juin 21:24 test-acl/
$ setfacl -dm u:bob:rw test-acl/ # user bob might exist on the system
$ ls -l test-acl/
total 0
-rw-rw----. 1 hux hux 0 23 juin 21:18 file1
-rw-rw----+ 1 hux hux 0 23 juin 21:24 file2
5. Remove ACLs
# cd /work/
# setfacl -x u:hux file1
# ls -l
total 8
-rw-r-----+ 1 root root 12 23 juin 21:44 file1
-rw-r-----. 1 root root 6 23 juin 21:42 file2
# getfacl file1
# file: file1
# owner: root
# group: root
user::rw-
group::r--
mask::r--
other::---
Remove all entries
# setfacl -b file1
Options:
-x : remove individual entries
-b : delete the entire ACL