Linux access Control List (ACL) is mainly used to control the user's permissions, you can do different users have different permissions on the same file, then how to operate it? The following small compilation teaches you how to set access control lists (ACLs) under Linux to control user permissions.
Working with LIUNX with rights control is an easy task. It can define the permissions of any user,group and other. This is great when you're on a desktop computer or you don't have a lot of user virtual Linux instances, or when users don't want to share files between them. However, if you are in a large organization, you run an NFS or Samba service to different users, and then you will need to be flexible in selecting and setting many complex configurations and permissions to meet the different needs of your organization.
Linux (and other POSIX-compliant operating systems such as UNIX) has a privilege control method called Access Control List (ACL), which is a universal paradigm beyond the assignment of permissions. For example, by default you need to confirm 3 permission groups: Owner, group, and other. With ACLs, you can add permissions to other users or groups, not just simple "other" or groups where the owner does not exist. You can allow specified users A, B, and C to have write permissions instead of having write permissions on their entire group.
ACLs support a variety of Linux file systems, including Ext2, Ext3, Ext4, XFS, BTFRS, and so on. If you are unsure whether your file system supports ACLs, refer to the documentation.
Make ACLs effective on file system
First, we need to install tools to manage ACLs.
In Ubuntu/debian:
$ sudo apt-get install ACL
In Centos/fedora/rhel:
# yum-y Install ACL
In ArchLinux:
# pacman-s ACL
For demonstration purposes, I will use the Ubuntu Server version, similar to other versions.
After the installation ACL is complete, we need to activate our partition's ACL function so we can use it.
First, we check to see if the ACL function is turned on.
$ mount