ACL permission Assignment
1.setfacl command Set file permissions
Setfacl-m U:USER1:RW root.txtsetfacl-m u:user2:rwx root.txt
2.getfacl Command View file permissions
Getfacl Root.txt
[Email protected] ~]# getfacl text.txt # file:text.txt# owner:root# group:rootuser::rw-user:wangteng:rw-group::r--mas k::rw-other::r--
3. Delete File permissions
Setfacl-x User:user3 Root.txt
4. Clear file Permissions
Setfacl-b Root.txt
5. Folder permissions
If you want to assign permissions to a folder, be aware that you must have the RX permission, if only R permissions, then the user can not enter the directory, if only x permissions, the user will be able to enter but not to view the directory files, if there is no W permission, the user delete cannot create the file
Setfacl-m U:user1:rwx/dir
6. Recursively set permissions on all subdirectories and their files in the directory
Setfacl-m U:user1:rwx-r/dir/
7. Maintain the same permissions for all subdirectories of the current directory and for newly created directories later
Setfacl-m D:user1:rwx-r/dir/
Set user Execute permissions on commands visudo command
Use the system to designate a user to create a user-specific example
Set up
Visudouser1 Localhost=/usr/sbin/useradd./usr/sbin/userdel//write this line of code to the bottom of the file
2. Using the Password sudo authorization command
sudo localhost=/usr/sbin/useradd newusersudo localhost=/usr/sbin/useradd-r newuser
3. Use the sudo command without password
sudo localhost=nopasswd:/usr/sbin/useradd-r newusersudo all=nopasswd:/usr/sbin/userdel-r newuser
ACL permissions control under Linux and setting user execution permissions on commands with sudo