again, the main purpose of this series of Linux blogs is not to introduce various commands, but to explore the theory behind the commands.
This article mainly introduces the user's creation and deletion.
Creating a user primarily uses the Useradd command, which allows you to specify various parameters when using this command. The general default is to: Useradd username. When we use the default values, they will help us with the project:
- Create a line of account-related data in/etc/passwd, including creating Uid/gid/master files, etc.;
- In/etc/shadow, the password related parameters of this account are filled in, but there is no password;
- Add a group name that is the same as the account name in/etc/group;
- Under/home, create a directory with the same name as the user's main folder, with permissions of 700.
In short, when using Useradd to create user accounts, the system will at least do the following for us:
- Files for user account and password parameters:/etc/passwd,/etc/shadow
- Files related to user groups:/etc/group,/etc/gshodow
- User's home folder:/home/account name
When creating a user, with many defaults, these values come from the Useradd reference file, which can be called using the following method:
The contents of the/etc/default/useradd file are displayed. The contents of the document are briefly described below:
- GROUP=100: The initial user group of the new account uses GID 100; in the system
Linux account Management (ii)