Home>Article>Operation and Maintenance> What are the linux file permissions

What are the linux file permissions

coldplay.xixi
coldplay.xixi Original
2020-10-23 15:00:05 41939browse

Linux file permissions are: 1. r is read-only permission; 2. w is write permission; 3. x is executable permission, 4. [-] means no permission; 5. Give by number File permissions, [Chmod 700 passwd] means that the root user has all permissions of rwx.

What are the linux file permissions

Linux file permissions are:

1. The meaning of r w x - in the file, r is read-only permission, w means write permission, x means executable permission, - means no permission.

The meaning of r w x in the directory, r has the ls permission, w can add, delete, and create permissions on the directory, and x has the ls –l permission.

2. Modify file permissions

The passwd file belongs to the root user and root user group. The current user can rw this file. Other users and the same group only have read-only permission r--, through Enter the tmp file directory and you can see that only the root user has all permissions on the passwd file, while other users in the same group do not have any permissions.

3. Chmod modifies the passwd file for all users and groups to add x executable permissions. By changing the permissions command chmod, add executable permissions to the root user and other users in this group. This is achieved through the command chmod a x passwd.

4. Chmod modifies the passwd file to delete x executable permissions for all users and groups. Use the chmod command to change the permissions to remove executable permissions for the root user and other users in this group. This is achieved through the command chmod a-x passwd.

5. Give file permissions through numbers, such as

- - - 0 0 0 0 - - x 0 0 1 1 - w - 0 1 0 2 - w x 0 1 1 3 r - - 1 0 0 4 r - x 1 0 1 5 r w - 1 1 0 6 r w x 1 1 1 7

Chmod 700 passwd means that the root user has all the permissions of rwx, and other users in the same group do not have any permissions.

6. User group permissions. All users belonging to this group have the same permissions. A group is a collection of users. The group ID is the GID, which is stored in /etc/group. Through cat /etc/ group View each group ID number, users in the same group can share files.

Related learning recommendations:linux video tutorial

The above is the detailed content of What are the linux file permissions. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn