Get the App
SLTechnology News&Howtos  ›  Servers  › 

Comparison of Chattr permissions and ACL permissions

Shulou Source: shulou.com Published: 2022-06-03 05:34:07 10月05日 Update

ACL permission Access: access Control: control List: list

Getfacl filename View ACL permissions

Setfacl options file name or directory set ACL permissions

Option:-m to set ACL permissions

-x removes specified user or group ACL permissions

-b remove all ACL permissions

-d set default ACL permissions default default

-k remove the default ACL permission

-R recursively set ACL permissions

Setfacl-mu: user name: rwx + file name sets ACL permissions to the user

In this file, give a user access to read and write execution

Setfacl-mg: group name: rwx + file name sets ACL permissions to the group

In this file, give read and write permissions to a group

Recursive ACL permissions: when the parent directory sets ACL permissions, all child files and subdirectories will have the same ACL permissions. (abide by ACL permission for existing files, and no ACL permission for newly created files)

Setfacl-mu: user name: permission-R + directory name

Default ACL permission: if ACL permission is set to the parent directory, all new child files in the parent directory will inherit the ACL permission of the parent directory. (abide by ACL permission for new files to be created in the future, no description for existing files)

Setfacl-m d: U: user name: permissions + directory name

Delete ACL permission

A) setfacl-x u: user name + file name removes the ACL permission of the specified user

B) setfacl-x g: group name + file name removes ACL permissions for the specified user group

C) setfacl-b + filename removes all ACL permissions for the file

Chattr permissions (you can change the properties of the file and have restrictions on root)

Chattr [+-=] [option] + file name or directory name

: add permissions: delete permissions

=: equal to a permission

Options: I: for files, deleting, renaming, adding and modifying data are not allowed, but

To see.

For a directory, you can only modify the file data under the directory, but you are not allowed to create and delete text

Pieces.

(equivalent to locking up a file or directory)

A: for files, you can only add data to the file, but you cannot delete or modify the data. (you cannot use vim to add or delete data, you can only use echo, such as: echo content > > file name.) for directories, only files can be created and modified in the directory, but deletion is not allowed. (equivalent to locking up existing data)

Tags: Permissions files directories file names users data user names directory names recursion same subdirectories subdirectories attributes user groups controls restrictions Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Apple Linux Shulou Technology vpn