Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Use the setfacl command of linux to set file ACL rules

2025-03-09 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

This article will explain in detail about the use of linux's setfacl command to set up file ACL rules. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

The English full name of setfacl is "set file access control list", that is, "set file access control list". Changing the command allows more precise control over the allocation of permissions, such as giving a user certain permissions on a file.

ACL refers to special permissions other than read / write / execute of the owner, group, and others of the file, which is helpful for usage situations that require special permissions. For example, a file is not accessible to a single user.

Syntax format: setfacl [parameters] [file]

Common parameters:

-m--modify-acl changes access control lists for files-M--modify-file=file reads access control list entries from files-x--remove=acl removes entries based on access control lists in files-X--remove-file=file reads access control list entries from files and deletes-b--remove-all removes all extended access control list entries-k--remove-default removes default access control columns Table-actions applied by d--default to the default access control list-P--physical follows natural logic Do not follow symbolic links-v--version displays version and exits-R--recursive recursive operation subdirectory

Reference example

Modify the acl permission of a file and add a user right:

[root@linuxcool ~] # getfacl test

File: test

Owner: root

Group: root

User::rwx

User:zwx:rw-

Group::r-x

Mask::rwx

Other::r-x

[root@linuxcool ~] # setfacl-Rm URV zwxRW-test

[root@linuxcool ~] # getfacl test

File: test

Owner: root

Group: root

User::rwx

User:zwx:rw-

Group::r-x

Mask::rwx

Other::r-x

Clear the ACL permissions for a directory:

[root@linuxcool ~] # setfacl-x u:zwx test

[root@linuxcool ~] # getfacl test

File: test

Owner: root

Group: root

User::rwx

Group::r-x

Other::r-x on the use of linux's setfacl command to set up file ACL rules is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report