We have around 100 user accounts on a Linux server, and 20 of them belong to my ITOp team. I want to allow my team user accounts to only view my files in a subdirectory directly under my /home directory. How can I control the file access permissions for these files?
1 Answer
Are the 20 users in the ITOp team in the same group?
If not, create a non-system group (man addgroup), and add the users to the group. Add yourself to the group, as well.
Change (man chmod) the permission of the directory to allow group read and execute (rwxr-x--- ).
Use chown (man chown) to change the group of the directory and the files you want to share to the group in paragraph 1.
Use chmod to change the file permissions to allow group read (rwxr-----).
Ensure the users can see the shared directory, by allowing group read access to your $HOME directory.
Explore your permission/ownership problems with https://github.com/waltinator/pathlld. A bash script to answer "Why can't I Read/Write that file?".
- 
        Thanks for your answer. It works!tleo– tleo2021-06-04 19:37:16 +00:00Commented Jun 4, 2021 at 19:37