ACL: Difference between revisions

From Leo's Notes
This page was last edited on 1 September 2019, at 06:20.
m Text replacement - "</code>" to "}}"
m Text replacement - "Category:Linux{{Navbox Linux}}" to "{{Navbox Linux}}Category:Linux"
 
(3 intermediate revisions by the same user not shown)
Line 3: Line 3:
To get ACL permissions
To get ACL permissions


<syntaxhighlight lang="bash" line start="1" enclose="div">
{{highlight|lang=terminal|code=
getfacl
# getfacl
</syntaxhighlight>
}}
 


To set ACL permissions for a user:
To set ACL permissions for a user:
<syntaxhighlight lang="bash" line start="1" enclose="div">
{{highlight|lang=terminal|code=
setfacl -m user:<user>:<perms> <path>
## setfacl -m user:<user>:<perms> <path>
 
## Eg.
# eg:
# setfacl -m user:leo:wrx /home/leo
setfacl -m user:leo:wrx /home/leo


# To do this recursively, pass the {{code|-R}} flag.  
## To do this recursively, pass the {{code|-R}} flag.  
setfacl -mR user:leo:wrx /home/leo
# setfacl -R -m user:leo:wrx /home/leo
</syntaxhighlight>
}}


To remove ACL permissions for a user:
To remove ACL permissions for a user:
<syntaxhighlight lang="bash" line start="1" enclose="div">
{{highlight|lang=terminal|code=
setfacl -x user:leo /home/leo
# setfacl -x user:leo /home/leo
</syntaxhighlight>
}}


To clone ACL permissions from fileA to fileB:
To clone ACL permissions from fileA to fileB:
<syntaxhighlight lang="bash" line start="1" enclose="div">
{{highlight|lang=terminal|code=
getfacl fileA | setfacl -bnM - fileB
<nowiki>
</syntaxhighlight>
# getfacl fileA | setfacl -bnM - fileB
</nowiki>
}}




[[Category:Linux]]
{{Navbox Linux}}[[Category:Linux]]

Latest revision as of 06:20, 1 September 2019

Linux

To get ACL permissions

# getfacl

To set ACL permissions for a user:

## setfacl -m user:<user>:<perms> <path>
## Eg.
# setfacl -m user:leo:wrx /home/leo

## To do this recursively, pass the <code>-R</code> flag. 
# setfacl -R -m user:leo:wrx /home/leo

To remove ACL permissions for a user:

# setfacl -x user:leo /home/leo

To clone ACL permissions from fileA to fileB:

# getfacl fileA | setfacl -bnM - fileB