Thank the Blogger: 52241685 information provided
Common Linux file permissions:
From left to right, 1-3 digits represent the permissions of the file owner, 4-6 digits represent the permissions of the same group of users, and 7-9 numbers represent the permissions of the other user.
And the specific permissions are represented by a number, the Read permission equals 4, with R, the permission to write is equal to 2, with W, the execution of the permission equals 1, denoted by x;
Through the combination of 4, 2, 1, the following permissions are obtained: 0 (no permission); 4 (Read permission); 5 (4+1 | Read + execute); 6 (4+2 | Read + write); 7 (4+2+1 | Read + Write + execute)
Take 755 as an example:
1-3 bits 7 equals 4+2+1,rwx, the owner has read, write, execute permission;
4-6 bits 5 equals 4+1+0,r-x, the same group of users have read, execute permission but no write permission;
7-9 bit 5, ibid., also r-x, other users have read, execute permissions but no write permission.
RWX Permission Number explanation
Chmod can also use numbers to represent permissions such as chmod 777 file
The syntax is: chmod ABC file
Each of the a,b,c is a number that represents the permissions of the user, Group, and other respectively.
To rwx the attribute then 4+2+1=7;
To rw-the attribute then 4+2=6;
To r-x the property, 4+1=7.
chmod a=rwx File
chmod 777 File
chmod ug=rwx,o=x File
chmod 771 File
Use chmod 4755 filename to give this program root privileges
Linux system 644, 755, 777 permissions detailed