Groups and permissions management
Introduction of Linux in the group
In the front we mentioned the concept of a group, which said, in Linux, each user must belong to a group, can not be independent from outside the group. In Linux every file there, all set of concepts owner, other groups.
File, directory owner
General file creator, who created the document, who is the owner of the file.
- Owner to view the file
command ls -ahl
- Owner to modify the file
command chown username filename
Create group
Command groupadd group name
Files, directories where the group
When a user creates a file, the default file where the group is the group to which the user is located.
-
Check the file directory where the group
command ls -ahl -
Modify the file's group
instruction chgrp group file name
Other groups
In addition to the user's group and owner of the file, other users of the system is a file that you love other groups.
Change the user's group
Command usermod -g group name username
command usermod -d directory name, user name (change the initial directory user login)
Basic introduction and modification rights
- Instruction ls -l view display is as follows
Type (d, 1) to determine the file of 0 -., L, C, B)
. 2) bits 1-3 determine the owner (owner of the file) have access to the file
3) of 4- permission 6 to determine the owning group (the same group of users) owns the file
4). 7-9 bitdetermining rights owned by other users of the file
-
Detailed permission
rwx role to file
1). [R] representatives can read
2). [W] representatives can write, you can modify, but not delete the file, delete the file precondition is the directory where the file write permissions to perform the deletion
3). [x] can be carried out on behalf ofrwx acting directory
1). [r] Representative readable, LS can view the contents of the directory
2). [w] Representative writable, can be modified, created in the directory, delete, rename
3). [x] class representatives execution, you can enter the directory
Modify permissions
1) The instruction chmod u = rwx, g = rw , o = x file directory name (change permissions)
2) The instruction chmod u + x file directory name (to add execute permissions to the file in the user group)
3). Instruction chmod a + x file directory name (the file for all users to add a.txt write permission)
3) the instruction chmod 744 file directory name (corresponding to a set of permissions for each user or 3, converted to decimal)
Modify the file owner
Instruction owner of the file name after the chown modify
instruction for all groups after the owner of the file name modification after modification chown
Modify the file's group
Command file name of the file where the group after chgrp modified
while studying records, if any deficiencies welcome message pointing ...