Linux FACL (File Access Control List)

The file has three permissions

  Owner Permissions Group Permissions Other Permissions

Now there is such a scenario, user A wants to share files to user B who is not in the same group, but does not want to modify other permissions, then FACL will work

FACL can add an extended permission to a file. At this time, you only need to add user B to the file extended permission list and give permission.

FACL usage:

  get file FACL

getfacl filename
$ getfacl facl.txt
# file: facl.txt    
# owner: eco
# group: eco
user::rw - 
user:tom:rwx         // Here, a rwx permission is assigned to user tom 
group::rw-
mask::rwx
other::r--

  Add FACL to file

setfacl - mu:username:permissions
eg:
    setfacl -m u:tom:rwx

  Cancel FACL

setfacl - xu:username
eg
    setfacl -x u:tom

 

Guess you like

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