Permissions for shared directories on Linux

application background

The shared directory of 5 people is located in the directory /home/cakingroups, which can only be used by these 5 people, and everyone can do any operation in this directory, while others have no right to use the permission of the directory. How to set it?

 

solution

Step 1: Create a directory

[root@localhost ~]# mkdir /home/cakingroups

Step 2: Give the cakingroup group permission to the /home/cakingroups directory

[root@localhost ~]# chgrp cakingroup /home/cakingroups

Step 3: Give the /home/cakingroups directory operation permissions

[root@localhost ~]# chmod 2770 /home/cakingroups

Step 4: View /home/cakingroups directory permissions

[root@localhost ~]# ll -d /home/cakingroups

drwxrws---. 2 root cakingroup 6 Nov  6 11:04 /home/cakingroups

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326403835&siteId=291194637
Recommended