Sunday, July 17, 2011

access control list (acl)

step1

let us create a file "abhi" on which we want to apply acl

#pwd
/
#touch abhi

check the permissions on the files

#ls -l  abhi

step 2

first check the permissions of the file abhi
#aclget abhi

the output will be

attributes:
base permissions
owner(root): rw-
group(system): r--
others: r--
extended permissions
disabled

here through enabling the extended permissions we are allowing or restricting particulars user oo groups from accessing the file abhi

after that run the command
#aclget -o abhi.acl abhi


 this command will create one file abhi.acl  where you can define the  extended permissions. the extended permissions will override the base permissions for mentioned users and groups. .

#vi abhi.acl
attributes:
base permissions
owner(root): rw-
group(system): r--
others: r--
extended permissions
enabled

permit rwx u:ashu
deny   rw-   g:maya


step3
applying the acl on the file abhi

# aclput -i abhi.acl abhi

step4 
verifying whether acl is working or not.

#su - ashu
$ vi  /abhi

if you are able to write on the file,it means acl is successfully applied.

No comments:

Post a Comment