Junior — Middle
How to restrict user group rights in Linux to only data viewing?
sobes.tech AI
Answer from AI
To restrict group users in Linux to only viewing data, you need to set file and directory permissions as follows:
-
Ensure that files and directories belong to the correct group.
-
Set permissions so that the group has only read and (for directories) execute rights:
- For files:
r--(read) - For directories:
r-x(read and traverse)
Example commands:
chgrp mygroup /path/to/data
chmod 750 /path/to/data # directory: owner rwx, group r-x, others ---
chmod 640 /path/to/data/file # file: owner rw-, group r--, others ---
Thus, group users will be able to view the contents but cannot modify or delete files.