I have created a group "restricted" and added a user "user1" to this group , how can I restrict this group to access some specified directory and drive.
New contributor
Anshuman Singh is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
-
What do you mean with "restrict"? Do you want only the members but not anyone else to have access? Or do you want everyone but the members of the group have access? Two very different scenarios.– MLuCommented Jul 6 at 5:25
Add a comment
|
1 Answer
You can change the owner group of the directory.
chgrp -R <group_name> <directory_name>
-R
- for recursive.
Replace <group_name>
and <directory_name>
with your actual group
and directory
names, respectively.
See man chgrp
for more details.
-
That's not a complete answer. Apart from the group ownership change you should also discuss
chmod
to adjust the permissions. Just changing the ownership won't do what the OP wants to do.– MLuCommented Jul 6 at 5:24 -