Permission control under Linux system
1.
file Permissions
in our Linux system , the permissions of a file or directory can be divided into 3 types :
R:4 Read
W:2 Write
X:1 Execution
Example :
644: (4+2) (4) (4)
First 6: The permissions of the owner of the current file , 6=4+2 readable writable permissions
Second 4: represents the group permission that the current file belongs to, 4=4 read -only permission
Third 4: represents the current file's out-of-group permissions , 4=4 readable permissions
2.
commands to view file permissions:(ls-l or LL)
The total can be divided into 7 major columns :
column 1 ( divided into ten columns ):
1: type of File ,- represents a normal file , D represents a directory , and L represents a soft connection ( equivalent to Shortcut to Window System )
Analyze Permissions with file Bigmovie.avi file
2-4: Current file owner's permissions (rw-), read writable permission ,- symbol indicates no corresponding permission
5-7: The owning group permission (r--) of the current file , readable permission
8-10: out-of-group permissions (r--) for the current file, readable permissions
column 2 : number of nodes in a file (node)
column 3 : Indicates the file owner root user
column 4 : the group root user group that represents the file belongs to
column 5 : shows the size of the file , the default is byte byte , You can use the command LS-LH more user-friendly view of file size
column 6 : Last modified time of file
Column 7 : Name of the file or directory
1.
user groups and users in Linux1.
Introduction
in our Linux system , There are many user groups , You can also create user groups manually , There are a lot of users under different groups of users .
2.
Create a user group and related commands
Groupadd Phpzu: Create a php Group
GROUPADD-G 501 Javazu: Create a group name Javazu, group ID 501 ( Note : System Group ID are less than , Custom Groups ID are greater than ( inclusive ))
Groupdel Phpzu: Delete Group named Phpzu
Groupmod-n New group name old group name
Groupmod-g New group ID old group name
① Creating a user group
column 1 : Group name
column 2 : Group Password
column 3 : group ID
column 4 : users within a group
② Deleting a user group
③ Modifying user groups
Permission control under Linux system