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.

2
  • Can you create a new group that contains only those people you want to share this directory with? Commented Feb 29, 2016 at 16:29
  • Are your filesystems ACL-enabled? Commented Feb 29, 2016 at 16:48

2 Answers 2

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.