Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am running Ubuntu 12.04 64bit server on ext4.

There are four user groups - marketing, sales, admin and etc.

I need to assign different permissions to /archive as follows:

rw for the marketing group
r for the sales group
rwx for the admin group
w for the etc user group

How exactly can I achieve this?

share|improve this question

1 Answer 1

Open terminal Ctrl+Alt+T and run following command :

Use Access Lists :

sudo apt-get install acl

1) Add the option acl to the partition(s) on which you want to enable ACL in /etc/fstab. For example:

 ...  
 UUID=07aebd28-24e3-cf19-e37d-1af9a23a45d4    /home    ext4   defaults,acl   0   2  
 ...

2) If necessary, remount partition(s) on which ACLs were enabled for them to take effect. For example:

sudo mount -o remount /home 

3) Verify that ACLs are enabled on the partition(s):

mount | grep acl

4) Add a group to acl

The utility setfacl is used to add the groups blue and green to the ACL for the directory /var/www.

sudo setfacl -m g:green:rwx /var/www/  
sudo setfacl -m g:blue:rwx /var/www/  
sudo getfacl /var/www/  
getfacl: Removing leading '/' from absolute path names  
file: var/www/  
owner: root  
group: root  
user::rwx  
group::r-x  
group:green:rwx  
group:blue:rwx  
mask::rwx  
other::r-x  
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.