LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Setting multiple group permission (https://www.linuxquestions.org/questions/linux-general-1/setting-multiple-group-permission-536793/)

terryyip 03-12-2007 07:57 AM

Setting multiple group permission
 
HI, I am a newbie on Linux.
I would like to set a multiple group permission.

For example:
There is a directory /home/notes
"student" is grouped as read-only for this directory, while "teacher" is another group that can read+write in this directory.

Do you have any suggestion? Thank you.

pixellany 03-12-2007 08:13 AM

A directory or file is assigned one owner and one group. The permissions are individually settable for owner, group, and other.

One easy way is for you to be the owner of the directory, assign "teachers" as the group, and let students be "other"

chown to set the owner and group
chmod to set the permissions

assign users to the "teachers" group using usermod

Look at the man pages for these commands for all the details--eg "man chmod"

jtshaw 03-12-2007 08:26 AM

If your system supports it I would recommend using access control lists instead of just normal permissions. This can allow you to set specific permissions for individual users and groups.

See man getfacl and man setfacl for information on how to set this up.

terryyip 03-12-2007 11:42 AM

Thank you! I used getfacl and setfacl to set the ACL and it worked! :D


All times are GMT -5. The time now is 11:03 AM.