Syntax:
To set the permission for any user# setfacl -m u:username:permission /path/to/directoryTo set the permission for any group
# setfacl -m g:groupname:permission /path/to/directory
To view the permission
To remove individual acl for any user
To remove all the acl added by setfacl
To remove the default acls on any directory
Examples:
To add an acl for user deepak with read and execute permission on mydata directory
To add an acl for group admin on any directories
To add the acl recusively on all the sub directories
To view the acl entries on mydata
# getfacl /path/to/directoryTo remove individual acl for any user
# setfacl -x username /path/to/directoryTo remove all the acl added by setfacl
# setfacl -b /path/to/directoryTo remove the default acls on any directory
# setfacl -d /path/to/directoryExamples:
To add an acl for user deepak with read and execute permission on mydata directory
# setfacl -m u:deepak:r-x /mydataTo add an acl for group admin on any directories
# setfacl -m g:admin:rwx /mydataTo add the acl recusively on all the sub directories
# setfacl -Rm -u:deepak:r-x /mydata/To view the acl entries on mydata
# getfacl /mydata
# file: new
# owner: root
# group: root
user:deepak:r-x
group:admin:rwx
group::r-x
mask::r-x
other::r-x# ls -l / | grep mydata
drwxr-xr-x+ 2 root root 4096 Oct 3 16:49 mydataSo here you can see '+' sign is added at the last of permission section of the directory which means that acl is active on that directory.
To remove a particular acl from the directory
# setfacl -x u:deepak /mydataTo remove all the acls from any directories
# setfacl -b /mydataFor further examples you can go to man page for setfacl
Follow below links for more tutorials
What is the difference/comparison between Unix and Linux ?
What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
Step by Step Linux Boot Process Explained In Detail
What is the difference between ext3 and ext4 filesystem in Linux ?
How to configure Private Network in VMware Workstation
10 examples to help you understand top command usage in Unix/Linux
Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
Understanding Load Average in Linux and when to be worried about it?
Disk Attachment Technology FC vs SAS vs iSCSI
Understanding UMASK value in Linux
How to keep a track of all the commands run by any user in Linux
How do you check Linux machine is Physical or Virtual remotely?
What are the maximum and minimum limits for RHEL 4 vs 5 vs 6 ?
Step by Step Linux Boot Process Explained In Detail
What is the difference between ext3 and ext4 filesystem in Linux ?
How to configure Private Network in VMware Workstation
10 examples to help you understand top command usage in Unix/Linux
Configure Red Hat Cluster using VMware, Quorum Disk, GFS2, Openfiler
Tutorial for Monitoring Tools SAR and KSAR with examples in Linux
15 tips to enhance security of your Linux machine
Why is Linux more secure than windows and any other OS
Understanding Load Average in Linux and when to be worried about it?
Disk Attachment Technology FC vs SAS vs iSCSI
Understanding UMASK value in Linux
How to keep a track of all the commands run by any user in Linux
How do you check Linux machine is Physical or Virtual remotely?
Give individual permission on directories using setfacl in linux
Reviewed by Deepak Prasad
on
Friday, October 05, 2012
Rating:
.png)


No comments: