The synopsis of this section is as follows:
1. User Management configuration file
2. User Management commands
3. User group Management commands
4. Batch Add Users
5. User authorization
Learn the principle first, so start with the configuration file.
1. User Information file/etc/passwd
The information of the user is stored
User name: Password bit: uid:gid: annotative Description: Host directory: Command parser
Linux is divided into three types of users
Uid=0 Superuser uid is 0 user is superuser and can be more than one
UID=[500,60000] Ordinary users
UID=[1,499] Pseudo-users, are some of the Linux system or process-related callers, so have to name the user, but the pseudo-user is not allowed to log in, because the corresponding shell is Nologin is not the shell, command can not communicate with the kernel. Can't login.
GID: User Group
A user group is a collection of the same users, and a user can belong to more than one group. However, the default group has only one.
A user must have a group, but this group can have only ID but does not exist. Also a powerful feature.
Users in the same group enjoy the functionality shared by the group. Group can not nest, win can, oh da.
Annotative description is really important in the management of the time who know that the user name corresponding to who ah, generally do a note will be better. Example: Sam user Name "This is the old king next door."
Host Directory
Command parser: It is generally bashell pull. For the user is Nologin AH
The old UNIX only recognizes 8-bit passwords. Weak chickens.
MD5 encryption is an input is not fixed but the output is fixed, one-way irreversible encryption. Commonly used to crack is known in the case of ciphertext, brute force, as long as the CPU fast enough, hehe, then use the Milky Way to calculate. There are no passwords that can't be counted. Because the number of real life is limited. But the time is infinite. Posterity is endless.
In the early years, the cipher cipher for Linux was really under passwd, wow. Everyone can see OH.
It was later put under the shadow for safety.
The main formats are:
User name: Password redaction: Last modified (this is the day from the date of the birth of Linux, 1970-1-1 to the last modified days, feeling dick): two times the minimum number of password modification days: The maximum time interval for a password:
Warning time (with the above buddies with the use of safety without side effects Oh, how many days in advance to prompt this friend to change the password): Account idle time (can see who who who how many days did not log system, is not with sister-in-the-run): Password expiration absolute days (similar to the Thunderbolt member, How many days you can't download at high speed): Logo (no use)
Why the cipher has been in the shadow and a password for the passwd, because the password modification and creation are first to passwd to shadow.
Can be viewed with Pwuncov and Pwcov
Manually add a new user immediately add a row under passed and shadow, then change the host directory owner, and then put the ETC/SKL file CP into the host directory.
/etc/login.defs
/etc/default/useradd
These two files are added to the command line user when some of the default settings are the same as before
Not the same as the following list
Whether Inactire=-1 is disabled
Expire= Failure Time
Snell= the default shell
Skei=/etc/skel
Create_mail_spool=yes whether to create one, add a host directory with that user name as the directory name
/ETC/MOTD prompt Message after login
/etc/issue Prompt information before login
Linux User Management (i)