Command | Description |
getfacl <filename> | View the current ACL of the file. |
setfacl -m g:cfsgroup:w <filename> | Set the write permission for the cfsgroup user group. |
setfacl -m u:cfsuser:w <filename> | Set the write permission for the cfsuser user. |
setfacl -x g:cfsgroup <filename> | Delete the permission of the players user group. |
getfacl file1 | setfacl --set-file=- file2 | Copy the ACL of file1 to file2 . |
setfacl -b file1 | Delete all extended ACL rules and retain basic ACL rules (owner, group, and others). |
setfacl -k file1 | Delete all default rules from file1 . |
setfacl -R -m g:cfsgroup:rw dir | Grant the cfsgroup user group the permission to read/write files and directories in the dir directory tree. |
setfacl -d -m g:cfsgroup:rw dir | Grant the cfsgroup user group the permission to read/write newly created files and directories in the dir directory tree. |
sudo useradd cfsuser # Create the `cfsuser` usersudo useradd otheruser # Create the `otheruser` usersudo groupadd cfsgroup # Create the `cfsgroup` user groupsudo usermod -g cfsgroup cfsuser # Allocate `cfsuser` to `cfsgroup`sudo touch file1 # Create a file named `file1`sudo setfacl -m g:cfsgroup:r-x file1 # Grant the `cfsgroup` user group the permission to read and execute `file1`sudo setfacl -m u:otheruser:rwx file1 # Grant the `otheruser` user the permission to read/write and execute `file1`
Was this page helpful?