<> Management of users and groups

<> user :

/etc/passwd User managed profiles

System users : Used to manage and run services , Login is not allowed by default /sbin/nologin

Ordinary users : Self created users .

1. Add user

command :useradd( If you do not specify a group , Will be assigned a UID Private group of )

2. Modify user information

3. Modify user home directory

method 1:

Create home directory while creating user

method 2:

If the user is not created at the same time as the user is created , At this time, switching users will fail

The following operations are required :

4. delete user

userdel -r qwe -r Delete the home directory and mailbox assigned by the user

<> group :

/etc/group

Classification of groups

Private group : When creating a user , If no base group is specified for this user , Then the user will automatically assign the same user uid Private group of .
Basic group :
Additional group : Except for the basic group , Users can also be assigned to other groups .

Create group

Landing group

Modification group

delete group

groupdel

Add user group

gpasswd zuming Set password for group

gpasswd -a maomao zu1( Group name ) Add group to user

gpasswd -M xixi,haha,maomao zu2 To add multiple users to a group in the form of a specified list

usermod -G zu1 maomao to maomao Users add additional groups

vim /etc/group Modify configuration file , Add the user name to the group's configuration file .

gpasswd -A maomao Designated team leader

gpasswd -d haha zu1 take haha User from zu1 Remove from

vim /etc/group Modify configuration file , Add the user name to the group's configuration file .

gpasswd -A maomao Designated team leader

gpasswd -d haha zu1 take haha User from zu1 Remove from

gpasswd -R zu1 Lock specified group , Only group members can enter this group

Technology