644, 755, and 777 permissions in linux, 644777
Detailed description of linux 644, 755, and 777 Permissions
Common linux File Permissions:
444 r --
600 rw -------
644 rw-r --
666 rw-
700 rwx ------
744 rwxr -- r --
755 rwxr-xr-x
777 rwxrwxrwx
From left to right, 1-3 digits represent the permissions of the file owner, 4-6 digits represent the permissions of users in the same group, and 7-9 digits represent the permissions of other users.
The specific permissions are represented by numbers. The read permissions are 4, r, 2, w, and 1, represented by x;
Through the combination of 4, 2, and 1, the following permissions are obtained: 0 (no permission); 4 (read permission); 5 (4 + 1 | read + execution ); 6 (4 + 2 | read + write); 7 (4 + 2 + 1 | read + write + execute)
Take 755 as an example:
1-3 bits 7 equals to 4 + 2 + 1, rwx. The owner has read, write, and execute permissions;
4-6 digits 5 equals to 4 + 1 + 0, r-x. users in the same group have read and execute permissions, but do not have write permissions;
7-9 digits 5. Same as above, it is also r-x. Other users have read and execute permissions but do not have write permissions.
Rwx permission numerical explanation
Chmod can also use numbers to indicate permissions, such as chmod 777 file.
Syntax: chmod abc file
Each a, B, and c is a number, indicating the permissions of the User, Group, and Other respectively.
R = 4, w = 2, x = 1
If you want the rwx attribute, 4 + 2 + 1 = 7;
If the rw-attribute is required, 4 + 2 = 6;
If you want the r-x attribute, 4 + 1 = 7.
Example:
Chmod a = rwx file
And
Chmod 777 file
Same effect
Chmod ug = rwx, o = x file
And
Chmod 771 file
Same effect
If chmod 4755 filename is used, the program can have root permissions.