In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
In this article, the editor introduces in detail "how to use the setfacl command of Linux". The content is detailed, the steps are clear, and the details are handled properly. I hope that this article "how to use the setfacl command of Linux" can help you solve your doubts.
The English full name of the commonly used command setfacl in Linux 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.
Syntax setfacl [- bkndRLP] {- m |-M |-x |-X...} file. Parameter-m,-- modify=acl change file access control list-M,-- modify-file=file read access control list entry change-x,-- remove=acl removes entry-X based on access control list in file,-- remove-file=file reads access control list entry from file and deletes-b,-- remove-all deletes all extended access control list entries-k -- remove-default removes the default access control list-- set=acl setting replaces the current file access control list-- set-file=file reads the access control list entry settings from the file-- mask recalculates the valid permission mask-n,-- no-mask does not recalculate the valid permission mask-d,-- default applies to the default access control list-R -- recursive recursive operation subdirectory-- L,-- logical according to system logic Follow symbolic links-P,-- physical follow natural logic, not follow symbolic links-- restore=file restores access control lists, as opposed to "getfacl-R"-- test test mode Does not really modify the access control list property-v,-- version displays the version and exits-h Example 1 [root@localhost ~] # getfacl test # file: test # owner: root # group: root user::r-x user:tank:rwx # effective:--- group::r-x # effective:--- mask::--- other::--- [root@localhost ~] # setfacl-m u:zhangy: Rw- test # modify acl permissions of a file Add a user right [root@localhost ~] # getfacl test # file: test # owner: root # group: root user::r-x user:zhangy:rw- # add an extra user user:tank:rwx group::r-x mask::rwx other::--- [root@localhost ~] # setfacl-m g:zhangying:r-w test # add a group [root@localhost ~] # getfacl Test # file: test # owner: root # group: root user::r-x user:zhangy:rw- user:tank:rwx group::r-x group:zhangying:rw- mask::rwx other::--- Last Update 2013-05-03 15:05:42-Co-editors are as follows: Zhang Ying is wrong Let me correct (0) correct (21) example 2 [root@localhost ~] # getfacl test # View acl # file: test # owner: root # group: root user::rw- group::r-- other::r-- [root@localhost ~] # setfacl-m u:tank:rx test # add acl rules that tank users read and execute to test files [root@localhost ~] # getfacl test # View acl # file: Test # owner: root # group: root user::rw- user:tank:r-x # has joined group::r-- mask::r-x other::r-- [root@localhost ~] # setfacl-m u::rwx test # to set the default user Read, write Executable [root@localhost ~] # getfacl test # file: test # owner: root # group: root user::rwx user:tank:r-x group::r-- mask::r-x other::r-- [root@localhost ~] # setfacl-b test # clear all acl [root@localhost ~] # getfacl test # file: test # owner: root # group: root user::rwx group::r-- other::r-- [root@localhost ~] # setfacl -m u:tank:rx test # add acl rules for reading and execution to test files for tank users [root@localhost] # setfacl-m u:testtank:rx test # add acl rules for reading and execution to test files for testtank users [root@localhost] # getfacl test # file: test # owner: root # group: root user::rwx user:testtank:r-x user:tank:r-x group::r-- mask::r-x other :: Rmuri-[root@localhost ~] # setfacl-x u:tank test # Clearing tank users The acl rules of test file [root@localhost ~] # getfacl test # file: test # owner: root # group: root user::rwx user:testtank:r-x group::r-- mask::r-x other::r-- has been introduced here, the article "how to use the setfacl command of Linux" has been introduced. If you want to master the knowledge points of this article, you still need to practice and use it before you can understand it. If you want to know more about related articles, Welcome to the industry information channel.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.