So I have 4 users on my redhat system.

*P- primary group

S- supplementary/secondary group*

UserA - P: Teacher S: USA

UserB - P: Teacher S: School

UserX - P: Student S: School

UserY - p: Student S: School, USA

How do I allow everyone in School/USA secondary groups to have read access to all users' home directories in the group? e.g. UserX should be able to read User B & Y's home directories because they are in the group School. But UserX cannot read UserA's home because UserX is not in USA.

UserY can read everyone's home.

  • haven't tried anything because I don't know how to even start!
    Jul 20, 2016 at 12:39
  • This is a very obvious homework (or other coursework) question. The place where you got it from gave you a question without a place to start figuring it out? Hint, read up on file/directory ownership & permissions.
    – phemmer
    Jul 20, 2016 at 12:41

1 Answer 1


The best and easiest thing you can do is to add groups to each of your users, i.e. modifying your users! This task can be done by using usermod command. Read more here. Be aware that -g option is for user's new initial group (i.e. Primary) while -G option is a list of supplementary groups which the user can be also a member of. You can get more information by reading usermod's manual page by running man usermod.

For permitting a member of a group to read everything under one's home directory, that home directory should have "read" permission bit on for groups, i.e. if your X home directory is drwx------, you should change it to be drwxr----- by using chmod command. For using permission bits wisely, read about them here. In addition you can read about SUID, SGID, and Sticky bits here. BTW, you should read this article to understand chmod, chown, and chgrp commands.

Let me know if you have any problems.

Good Luck

  • 1
    BTW, add -a option with the -G option if you want to append.
    – user172564
    Jul 20, 2016 at 20:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .