A low-privileged user generates a new file to a writable directory, and since the new file does not inherit the writable permission, the user cannot modify the operation of the file after the build.
Use the Setfacl command to automatically inherit the new file's permissions from the parent folder (-D parameter inheritance)
Setfacl-r-d-m u: User: rwx File/Folder
======================================================
Linux permissions inheritance, using Setfacl to divide permissions
Linux file permissions are classified as owner group other
Such as:
DRWXRWX---5 wdj wdj 4096 09-26 11:51 test
If the user soft want to have read and write access to the test directory, one is to add the soft user to the WDJ group. The other is to change other permissions to RW
If you want the files or directories under this directory to inherit permissions from the parent directory, you should chmod-r every time .... A bit
You can now use SETFACL to solve these problems
Setfacl-r-M u:soft:rwx test
Shell>ll
DRWXRWX---+ 5 wdj wdj 4096 09-26 11:51 test
This allows the soft user to manipulate the test directory
setfacl-d--set u:soft:rwx Test
-D is to have subdirectories inherit parent directory permissions
To view ACL permissions using the GETFACL command
[Email protected] data]$ GETFACL test
# File:test
# OWNER:WDJ
# GROUP:WDJ
User::rwx
User:soft:rwx
Group::rwx
Mask::rwx
Other::---
Default:user::rwx
Default:user:soft:rwx
Default:group::rwx
Default:mask::rwx
Default:other::---
Setfacl-x U:soft Test
Remove permissions for individual users
Setfacl-b Test
Delete the test directory so ACL permissions
Linux File Permissions inheritance