by Devin Yang
(This article was automatically translated.)

Published - 5 years ago ( Updated - 5 years ago )

I think most of the current Linux supports Access Control List (ACL). With filesystem ACLs enabled,
We can set additional permissions to different users or groups.
This allows us to set the file system permissions of different users more freely.

Go straight to the command.
The u at the bottom represents setting the share folder, and the test user has rwx permission.
setfacl -m u:test:rwx share/
Changing to g means that the group that sets test has rwx permission to the share/folder.
setfacl -m g:test:rwx share/
If you want to set all files in the directory that also includes subdirectories, the parameter is -R. (recursive)
Combined input is -Rm.

Here comes the problem, if it is set like this, all files will have execution permission. So how to set
Files do not have x permissions, only directories have x execution permissions (permissions to enter directories).
Very easy, we can do it with a capital X.
E.g:
setfacl -Rm u:git:rwX /var/www
This way there will be a beautiful color instead of a miserable green.

As a side note, we use getfacl to get additional file information.
For example: I set the git user as root with the following permissions.
setfacl -Rm u:git:rwX humanity-1.10.4/
Use git user to view

In the picture above, have you noticed -rw-rw-r--+. When ls -l, there is an extra +.
It is very obvious, which means that this file has additional ACL permission settings.

Now use getfacl images to see the user (user) authority of the images directory, which has execution authority.

If you like this article, please give me a Like? 

 

Tags: linux

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


linux,docker

How to execute X client and X Window in Container (docker gui)

Today I will talk to you about X, not iPhone X, nor X-Men, but X Window System, He is the main graphical interface display component of the current Linux system. Since it is very easy to expand and modularize, it has been used since it was established in 1986. The X Window system adopts the Client/Server architecture, which splits the application program and the display into two. The application program of X Windows is usually called X Client, and the display is the well-known X Server. The X client communicates with the X server through the X protocol (X protocol), which is an asynchronous network communication protocol.

Laravel linux

My mobile computer, install Laravel 8 on Sony xperia 5 II

This is my first Android phone. It's no problem to try to install Laravel. Basically, I installed vim and mariadb. After executing sshd, you can log in through 8022, it is completely a mobile computer: p. The software I use is Termux...

linux

Remove the Linux Kernel that is not used by the old version on Ubuntu

This page describes how I removed the old version of Linux Kernel taking up space on ubuntu.