0

I have three users in Redhat 6 machine,

tiger
gourav
sourav

User gourav and sourav in brother group.
Now user tiger create a directory tiger_gaurav and want to give read and write permission to only and only gourav user.

When I try to give permission according to group,sourav also gets the permission to access that directory. Please do help me with this.

  • Can you create a new group that contains only those people you want to share this directory with? – Eric Renouf Feb 29 '16 at 16:29
  • Are your filesystems ACL-enabled? – Ulrich Schwarz Feb 29 '16 at 16:48
3

Using ACL's this can be done (Red Hat - Setting Access ACLs) -

$ setfacl -m u:gourav:rwx,d:u:gourav:rwx,d:u:tiger:rwx,m:rwx path/tiger_gaurav
  • u:gourav:rwx — grants user gourav read,write, and execute to the directory
  • d:u:gourav:rwx — sets the default rule that will grant user gourav read,write,execute permission to files created in the directory
  • d:u:tiger:rwx — sets the default rule that will grant user tiger read,write,execute permission to files created in the directory
  • m:rwx — sets the mask, this value is unioned with the owning group and all other users/groups.

That said, creating a group is likely much simpler to maintain in the long run.

2

Create a group that only the two belong to, and use that as group access. Remember, an account can be a member of many groups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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