Tuesday, March 20, 2007

UBUNTU ACL on EXT3

Access Control Lists (ACLs) provide a flexible way of specifying permissions on a file or other object than the standard Unix user/group/owner system.

Windows NT and above, when running on an NTFS partition, use ACLs to specify permissions on files and directories.

This document show how you may enable ACL support on your Linux UBUNTU box.

Install ACL in UBUNTU

#apt-get install acl

Activating ACL support on a partition (Ext3)

By default kernel version 2.6 support ACL on ext3. If you have already partition(ex: hda1) you need to use the following command
#mount -o remount,acl /dev/hda1
Now we need to modify the /etc/fstab file and add the ACL options
/dev/hda1 / ext3 {{acl}},defaults,errors=remount-ro 0 1


Adding and Modifying ACL
In Order to use ACL under Linux you need to use two commands setfacl and getfacl

If you want to get the ACL of test.acl file you need to enter the following command

#getfacl test.acl

If you want to add user(u) ruchi with write(w) access on test.acl file you need to enter the following command
#setfacl -m u:ruchi:w test.acl

If you want to add group(g) root with read(r) access on test.acl file you need to enter the following command

#setfacl -m g:root:w test.acl

If you want to add others(o) with read(r) access on test.acl file you need to enter the following command

#setfacl -m o::r test.acl

Happy hunting.

No comments: