Simple operations on linux users and user groups, and file permissions can be created only with root permissions. New linux users adduser AB can be created with the name AB. New users do not have a password, note that users without passwords cannot log on. Passwd ad sets a password for user AB. On the terminal, you can see: Changing password for user AB. new UNIX password: bad password: it is based on a dictionary wordRetype new UNIX password: passwd: all authentication tokens updated successfully. id AB on the terminal, you can see the user's basic information uid = 509 (AB) gid = 509 (AB) groups = 509 (AB) 1-500 is the system Reserved uid, therefore, the new user number starts from 501. We use the same method to create another user tq and add tq to the user group 0 (root) uid tq. We can see that uid = 508 (tq) gid = 508 (tq) groups = 508 (tq), 0 (root) uid = 508 (tq) indicates that the uidgid of tq = 508 (tq) is the default group that the uid of tq belongs. Groups = 508 (tq). The uid 0 (root) tq belongs to the root user. The tq group has the root permission and can add a user to other groups. Cat/etc/group [root @ AY12081302515006590e3 tq] # cat/etc/grouproot: x: 0: root, tqbin: x: 1: root, bin, daemondaemon: x: 2: the red part of root, bin, and daemon is the newly added information. But note that only root can modify the file/etc/group. Why? Ll/etc/group-rw-r -- 1 root 775 04-13/etc/group the first root represents the owner of this file, the second root indicates the group to which the file belongs-rw-r -- indicates the user's permission on the file on linux. The first character represents the file type, the d represents the directory, and the next three characters represent the permissions of the file owner, the next three characters indicate the permissions of the users in the file owner group. The last three characters indicate the permissions of other users [root @ AY12081302515006590e3 tq] # ll total 4-rw-rw-r -- 1 tq 0 04-13 1drwxrwxr-x 2 tq 4096 04-13 20:05 2-rw-rw-r -- 1 tq 0 04-13 text note that here "total 4" indicates the total of the Directory and the files below the number of blocks used. This is a file under tq. su AB switches to user AB and finds that the ls command has insufficient permissions. lsls :.: The permission is insufficient because ls needs to access the/home/tq directory, and we find that drwx ------ 4 tq 4096 04-13 20:12 tq indicates that the permissions of other users are empty, no permission. It can be seen that if you do not have permissions on a directory, you do not have the corresponding permissions on the files under it, even if the following files are configured with permissions. In addition, the root permission is greater than everything else. ========================================================== ================================== You can use chmod to change the File Permission syntax format: the chmod [who] [opt] [mode] File/directory name indicates the object, which is one or both of the following letters: u: indicates the file owner g: indicates the same group of users o: other user a: indicates that all users opt indicates an operation. You can add a permission to the operation: +: cancel a permission =: grant the given permission, and cancel the original permissions, while the mode indicates the permission: r: readable w: writable x: executable for example: to increase the read and write permissions for file a.txt for users in the same group: chmod g + rw a.txt