In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use ACL tools to back up and restore Linux file permissions". In daily operation, I believe many people have doubts about how to use ACL tools to back up and restore Linux file permissions. Xiaobian consulted all kinds of materials and sorted out simple and easy-to-use methods of operation. I hope it will be helpful to answer the questions of "how to use ACL tools to back up and restore Linux file permissions". Next, please follow the editor to study!
As a system administration, our first priority will be to protect and unauthorized access to secure data. We all know that we set up to use something like CHMOD,CHOWN,chgrp commands. Useful Linux commands, however, these default permission settings have some restrictions, sometimes not according to the work permissions we need. For example, we cannot set different permission sets for different users on the same directory or file. As a result, access control lists (ACL) are implemented.
1. Install ACL tools
On Debian, Ubuntu,Linux Mint
$sudo apt-get install acl
On CentOS,Fedora,RHEL
$sudo yum install acl2. The permission to back up all files under the current directory (including subdirectories) [root@linuxprobe tmp] # ls-ltotal 8 RWXR Murray. 1 root root 0 Mar 3 04:40 install.txt-rwxr-xr-x. 1 root root 0 Mar 3 04:41 linuxprobe.txt [root@linuxprobe tmp] # getfacl-R. > permissions.txt...
This command writes all the ACL information for all files into a file named permissions.txt.
The following is some directory information in the generated permissions.txt file
[root@linuxprobe tmp] # cat permissions.txt# file:. # owner: root# group: root# flags:-- tuser::rwxgroup::rwxother::rwx# file: install.txt# owner: root# group: rootuser::rwxgroup::r--other::r--# file: linuxprobe.txt# owner: root# group: rootuser::rwxgroup::r-xother::r-x# file: permissions.txt# owner: root# group: rootuser::rw-group::r--other::r--...3. Modify a file permission, such as: modify linuxprobe.txt and install.txt permissions [root@linuxprobe tmp] # chmod 733 linuxprobe.txt [root@linuxprobe tmp] # chmod 573 install.txt [root@linuxprobe tmp] # ls-ltotal 8-r-xrwx-wx. 1 root root 0 Mar 3 04:40 install.txt-rwx-wx-wx. 1 root root 0 Mar 3 04:41 linuxprobe.txt-rw-r--r--. 1 root root 4361 Mar 3 04:41 permissions.txt.4. Restore the original authority
1) cd to the directory where the permissions.txt was created 2) execute the following command:
Setfacl-restore=permissions.txt
You can see that linuxprobe.txt and install.txt permissions have been restored.
[root@linuxprobe tmp] # setfacl-- restore=permissions.txt [root@linuxprobe tmp] # ls-ltotal 8 Murray RWXR Murray. 1 root root 0 Mar 3 04:40 install.txt-rwxr-xr-x. 1 root root 0 Mar 3 04:41 linuxprobe.txt-rw-r--r--. 1 root root 4361 Mar 3 04:41 permissions.txt. At this point, the study on "how to use the ACL tool to back up and restore Linux file permissions" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
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.