Getting started with Linux: A Brief Description of Linux File Permissions
In Linux, each file or directory contains access permissions, which determine who can access and how to access these files and directories.
By setting permissions, You can restrict access permissions in the following three ways: allow only the user to access (owner); Allow access (user group) from a user group specified in advance ); allow access by any user in the system (other users ).
The owner is the user who creates the file. The user is the owner of the file created by all users. The user can allow the user group to access the user's file.
Generally, users are combined into user groups. For example, all users in a certain type or project can be classified as one user group by the system administrator, A user can grant file access permissions to other members of the user group.
Finally, users can open their files to all users in the system. In this case, all users in the system can access their directories or files. In this sense, all other users in the system are the other user class.
This is similar to the access permission of the QQ space. This QQ space belongs to me. I am equivalent to a manager (that is, the "owner, I can set to allow access by QQ friends, and these QQ friends are similar to "user groups". Of course, I can allow access by all people, and everyone here is similar to "other users ".
At the same time, you can control the access level of a given file or directory. a file or directory may have read, write, and execution permissions.
Each user has its own read, write, and execution permissions.
The first group of permissions controls access to their own files, that is, the owner permission.
The second group of permissions controls the user group's permission to access one of the user's files.
The third group of permissions controls the permissions of all other users to access a user's files.
These three groups of permissions grant the read, write, and execute permissions of different types of users (I .e. owners, user groups, and other users) to constitute a permission group with nine types.
The 1st letters indicate the file type: "d" indicates a folder, "-" indicates a common file, "c" indicates a hardware character device, "B" indicates a hardware block device, and "l" indicates a soft link file.
The last nine letters indicate the permissions of the file owner, user, and other users.
R (read): For a file, you have the permission to read the file content; for a directory, you have the permission to browse the directory.
W (write): For a file, you have the permission to add or modify the file content. For a directory, you have the permission to delete or move files in the directory.
X (execute): For a file, you have the permission to execute the file. For a directory, you have the permission to enter the directory.
-: You do not have any permissions.
Linux ACL permission planning: Use getfacl and setfacl
Linux permission supplement: rwt rwT rws rwS special permissions
Linux User and User Group Permissions
Three special Linux permissions: setuid setgid stick bit
This article permanently updates the link address: