Welcome to the Linux Foundation Forum!

linux groups

i have 3 directories d1 d2 d3 and have 3 users u1 u2 u3 and 3 groups g1 g2 g3, How can i allow that u1 u2 can write & read data from d1, u1 u3 can write & read data from d2, u2 and u3 can view or write data in d3, No one else don't have rights to these directories

i have added u1 in group g1 and g2 and similarly added others users to the specified groups accordingly but i am not sure how to make the access rights on these directories

Need a little help




  • Goineasy9
    Goineasy9 Posts: 1,114
    Well, you obviously know about groups in Linux, and you can assign each of the users individual rights to the groups. I may be missing something, are you looking for directions how to set up groups? Or are the groups not working properly after you set them up?
  • Well i have added the users into group (e.g. u1 u2 in group g1 and u2 u3 in group g2) successfully. then i have the dir. d1 which can be only accessible by users in g1 and d2 by g2. i tried the chgrp on the directory but still user u3 or other users can access it.

    Yes i want to setup directories to be setup for the groups. I know i am close but missing something.
  • mfillpot
    mfillpot Posts: 2,177
    What you are proposing requires more than than one group to be assigned to the specific directory which I do not think can be done. In my experience you only get owner, group and all users rights on a file or directory.

    You can set the directory to be owned by u1 and g2 then set the permissions to 775 so u1 and all g2 users have full access, but all other users can only read the files, but not modify them. Then again I don't think that will even fulfill you needs, you could read into selinux permissions to see if that system may better fit your needs.


Upcoming Training