setfacl

Sets Access Control Lists (ACLs) of files and directories. Returns 0 on success and non-zero on error.

The usage is as follows:

$ hadoop fs -setfacl [-R] [-b
|-k -m |-x <acl_spec> <path>] |[--set <acl_spec> <path>]
Arguments

-b

Removes everything, but the base ACL entries. The entries for user, group, and others are retained for compatibility with permission bits

-k

Removes the default ACL

-R

Applies operations to all files and directories recursively

-m

Modifies ACL. New entries are added to the ACL, and existing entries are retained

-x

Removes specified ACL entries. Other ACL entries are retained

--set

Fully replaces the ACL, discarding all existing entries.

The acl_spec must include entries for user, group, and others for compatibility with permission bits. If the acl_spec contains only access entries, then the existing default entries are retained. If the acl_spec contains only default entries, then the existing access entries are retained. If the acl_spec contains both access and default entries, then both are replaced

acl_spec

A comma-separated list of ACL entries

path

A path to the file or directory to modify

Example:

$ hadoop fs -setfacl -m user:hadoop:rw- /file
$ hadoop fs -setfacl -x user:hadoop /file
$ hadoop fs -setfacl -b /file
$ hadoop fs -setfacl -k /dir
$ hadoop fs -setfacl --set user::rw-,user:hadoop:rw-,group::r--,other::r-- /file
$ hadoop fs -setfacl -R -m user:hadoop:r-x /dir
$ hadoop fs -setfacl -m default:user:hadoop:r-x /di
Found a mistake? Seleсt text and press Ctrl+Enter to report it