Linux_005 _ user, group and permission base Linux_004 _ disk and file system http://www.bkjia.com/ OS /201306/223130.html 1. there are three types of users:-root user (ID 0)-system user (1-499)-common user (more than 500) id: displays the information of the current user. passwd: modifies the password of the current user. whoami: displays which users have logged on to the system. w: displays which users have logged on to the system. Related Files/etc/passwd save User Information/etc/shadow Save User Password (encrypted) /etc/group save group information 2. user management create user useradd nash_su this command will execute the following operations (1 ). add User information to/etc/passwd (2 ). if you use the passwd command to create a password, save it in/etc/shadow (3 ). create a new home directory/home/nash_su (4) for the user ). copy the files in/etc/skel to your home directory (5 ). create a group with the same user name, by default, the new user belongs to the same name group parameter-d home directory-s. log on to shell-u userId-g main group-G affiliated group (up to 31 sub-groups can be separated by commas) modify usermod parameter username-l username-u userid-d home directory-g main group-G affiliated group-L lock so that it cannot log on-U unlock delete user userdel nash_su keep home directory userdel-r nash_su Delete home directory at the same time 3. group Management groupadd linuxcast create group groupmod-n newname oldname modify group name groupmod-g newGid oldGid modify group idgroupdel linuxcast Delete Group 4. permission management (1 ). permissions are generally divided into read (r), write (w), and execute (x). Each process runs as a user, so the process has the same permissions as the user, if the user has a large permission, the process has a large directory and must have x permissions; otherwise, the content cannot be viewed (2 ). UGO permission drwxr-xr -- 2 nash_su training 208 Oct 1 linuxcast.net file type U permission G permission O permission link quantity u g size time file name (3 ). change File Permission chown nash_su linuxcast.net change file linuxcast.net user-R parameter recursively modify all files under directory user chgrp nash_su linuxcast.net change file linuxcast.net group-R parameter Recursion modify the chmod mode file mode of the group to which all files under the directory belong to u in the following format, g, o stands for users and groups respectively. Other a can represent ugo +.-represents joining or deleting r, w, and x represents three permission examples: chmod u + rw linuxcast.net adds the read/write permission to the user of the linuxcast.net file. chmod g-x linuxcast.net removes the execution permission from the group of the linuxcast.net file and digitally modifies the permission-r = 4-w = 2-x = 1 rw = 4 + 2 = 6rwx = 4 + 2 + 1 = 7r-x = 4 + 1 = 5 For example: chmod 660 linuxcast. ne