User Management
Creation User
useradd [option] ussername
Deletion User
userdel [option] username
Serching User Information
id userName
Switching User
su feige
Modification User Information
usermod [option] Username
Change Users Password
passwd [option] Username
改变用户所在组
usermod -g groupName userName
Group Management
Linux的每个用户必须所属一个组,不能独立于组外,在创建用户的时候如果不指定组就会创建一个和用户名相同的组,一个用户可以隶属于多个组。
Addition Group
groupadd [option] groupname
Deletion Group
groupdel groupname
Modification User Group
groupmod [option] usergroup
Switching group
newgrp groupname
Relation System File
There are many ways to complete the work of user management, but each method is actually to modify the relevant system files.
1、Linux系统中的每个用户都在/etc/passwd文件中有一个对应的记录行,它记录了这个用户的一些基本属性。
2、Linux系统把加密后的口令字分离出来,单独存放在一个文件中,这个文件是/etc/shadow文件。
3、Linux用户组的所有信息都存放在/etc/group文件中。