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 migrating my home server from windows based to ubuntu based server.
I am happy and satisfied with my Windows XP based file server and have been using it for about 6 years now.

I am decommissioning the Windows XP
server and wish to use my new linux server based on Ubuntu 12.04 LTS Desktop edition. I plan of using the server edition when I'll be satisfied with the desktop edition.
But right now, I am having some problem with FILE PERMISSION in my new Ubuntu server.

In my Windows XP, I've shared a 4TB RAID0 array and the whole of it is shared within my workgroup. I have several users with different user permissions and I wanted this to be applied also in my Ubuntu server. But I am having some problem implementing it. Probably because of my lack of knowledge administering it.

Right now, In my Ubuntu server, I created a 4TB RAID Array and the whole of it is shared.

The contents of the RAID array is chowned recursively to admin-one:users.
The contents of the RAID array is chmoded recursively to 750.
In the server I have created the user-one and user-twoaccount that belongs to users group.

In the shared RAID array, I have a folder called restricted. Everything is setup well and runs fine with the client machine.

The problem now is, I have no idea on how shall I restrict user-one from accessing the restricted folder, since user-one belongs to users group that has read and execute permission for the whole contents of the RAID array and from where the restricted folder is located too. I can easily do this in windows, but not in Ubuntu.

To summarize the user's permissions:

admin-one - has read write execute permission to the whole shared partition.
user-one - has read and execute permission to the whole shared partition.
user-two - has read and execute permission to the whole shared partition.

And what I want to accomplish is:

user-one - has read and execute permission to the whole shared partition but shall have no access to the restricted folder.

user-two - has read and execute permission to the whole shared partition that includes the restricted folder, BUT shall have not write permission to the folder.

So, the general question is, how shall I set different permissions to different users?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

You can use ACLs (a page to read about it: https://help.ubuntu.com/community/FilePermissionsACLs). ACLs work without any configuration needed at least in Ubuntu 13.04. I have no idea if they work in Ubuntu 12.04 straight away. If they don't, you could enable ACLs (search around how to do it) or ignore my answer.

  • To restrict user-one from accessing the restricted folder, you could run the command:

    sudo setfacl -m u:user-one:- restricted
    
  • To give user-two only read/write permission to the folder:

    sudo setfacl -m u:user-two:rw restricted
    
  • To remove all ACLs from the folder:

    sudo setfacl -b restricted
    
  • To view the ACLs of the folder:

    getfacl restricted
    

    Also, when you use the command ls -l to view the standard permissions of the folder, you will see an additional '+' in the permissions.

Again, I don't know if ACLs are enabled by default in Ubuntu 12.04. If these commands fail, then ACLs are not enabled.

share|improve this answer
    
yes, it's enabled in 12.04. I'll dig further and apply those above. –  Gary Lising Aug 12 '13 at 18:53
    
thanks for introducing me to ACL, It got the job done!. It did not work in my first try. Then I did some further reading from the link above. Then I've enable acl support by adding acl option in my fstab for my RAID array. And It's working... –  Gary Lising Aug 12 '13 at 20:10
    
You're welcome! –  Bruno Nova Aug 12 '13 at 20:35

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.