Ads Top

How to configure ACL in Linux

ACLs can be configured:

 1.Per user
2. Per group
3.Via the effective rights mask
4.For users not in the user group for the file

Enable ACL support on the partition.
Edit /etc/fstab file and change the default parameter to rw,acl
If we want to enable acl for /mnt

Now, you will need to remount the /mnt partition with the "acl" option. The easiest way to do this is with the "remount" option, since it will work even while the partition is in use:

[root@vishal /]# mount -v -o remount /mnt/
/dev/sda5 on /mnt type ext3 (rw,acl)

Create a user and group:-
 [root@vishal /]# useradd vishal
[root@vishal /]# groupadd linux
[root@vishal /]# usermod -a -G linux vishal

Now, we can actually start using ACLs. The basic commands that we are interested in are:

[root@vishal /]#  setfacl -m u:vishal:rw- /mnt/
[root@vishal /]#  getfacl /mnt/
getfacl: Removing leading '/' from absolute path names
# file: mnt
# owner: root
# group: root

To remove all the permissions for a user, group, or others, use the -x option and do not specify any permissions:
[root@vishal /]# setfacl -x rules files

Vishal Vyas

No comments:

'; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; dsq.src = '//' + disqus_shortname + ''; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })();
© 2020 Vishal Vyas. All rights reserved. Theme images by Jason Morrow. Powered by Blogger.