File permissions and user groups
Groupadd Group Name
Groupadd Policeman
View Groups
Vi/etc/group
Cat/etc/group
Create a user and specify which group to assign the user to
USERADD-G Group name User name
View all user information in Linux
vi/etc/passwd
cat/etc/passwd
-rw-r--r--
-representative file type
rw-represents the file's owner's permissions on the file
The permissions are divided into three types, R can be read with 4 means W writable 2 means x executable with 1 means
r--represents the permissions for the file in the same group.
The last r--represents the permissions of the other group's users on the file.
How to modify the access permissions of a file
chmod 777 User 7 is exactly r (4) +w (2) +x (1) =7
chmod 777 along
chmod 770 Along the result is: drwxrwx---
chmod 664 Aaa.java
Add user specifies which group to add, same as root admin permission can change a user's group
USERMOD-G Group name User name
usermod-d Directory name User name change the initial directory where the user is logged on
Linux the next day