In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "the specific usage of chacl command in Linux". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Chacl is a command used to change the access control list of a file or directory. It is similar to chmod. But more powerful and more elaborate than chmod.
Chmod can only divide permissions into three categories: users, groups, and others. Through chmod, you can specify the permissions of the owner of the file, the permissions of the users of the group in which the file belongs, and the permissions of others.
If there is such a demand, can it be done through chmod? If user A's file only wants to be shown to B. Can it be done through chmod. Of course, you may say that it is OK to put Amemery B into a group. But you will restrict other users from joining this group. This problem can be easily solved through chacl.
The format of the chacl command is: chacl acl filename1 filename2
Acl is the access control list in English, so I'll literally translate it into an access control list. Chacl is a command that changes the file access control list.
Acl is a string that can be parsed by acl_from_text programs for each user's rights. The string is separated into multiple fragments by commas
The form of each segment is like: tag:name:perm
Tag can be one of the following forms:
"user" (or "u")
Indicates that this is a user's ACL entry.
"group" (or "g")
Indicates that this is an ACL entry for a user group.
"other" (or "o")
Indicates that this is another ACL entry. That is, there are no ACL entries for the users and groups specified in ACL.
"mask" (or "m")
Indicates that this is a masked ACL entry. This mask entry must be specified when specifying ACL permissions for other non-user owners, otherwise executing the chacl command will cause an error.
Name can be a user name or a group name. If not specified, the default is to assign acl permissions to the owner or user group of the file or directory. Of course, name can also be the uid of the user or the gid of the group.
Perm refers to the permissions that the user or group has. It is a string made up of "rwx". Of course, everyone knows what it means. If you want the user or group not to have some permission, simply replace the specified letter with a "-". For example, "rmurx" only has read and execute permissions.
This command does not have many options, so let's describe the meaning of each option in detail.
-b indicates that there are two acl that need to be modified, the former acl is the acl of the file, and the second is the default acl of the directory.
-d sets the default acl of the directory, which is useful. If you specify the default acl for a directory, new files or directories under this directory will inherit the acl of the directory.
-R deletes only the acl of the file
-D deletes only the default acl of the directory, which is the reverse operation of-d.
-B removes the default acl for files and directories. Is the reverse operation of-b.
-r recursively modify the acl permissions of files and directories.
-l lists the acl permissions for files and directories.
Example:
The code is as follows:
[root@localhost ~] # chacl uvvl Ruki x GRV RLI RLIX, oRV RLI RWX mlTANKLI RWX MULTANKRIX-test
[root@localhost ~] # getfacl test # acl permission to view files
# file: test
# owner: root
# group: root
User::r-x
User:tank:rwx # effective:
Group::r-x # effective:
Mask::
Other::
This is the end of the content of "specific usage of the chacl command in Linux". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.