User's creation and deletion:
Useradd adding users
-U Specify UID
-D Specify the user's home directory
-M does not set up a home directory, if you want to create a home directory: You can create a home directory, such as Mkdir/home/username, and then
cp/etc/skel/.ba*/home/username, you can log in to the home directory.
-S Custom shell
Userdel Deleting a user
-R Delete the user at the same time, along with the home directory deleted
Groupadd Adding user groups
Groupdel Deleting a user group
-G Specify GID
Usermod Modifying user information
-D Modify Home directory
-G Modify User Group
-S Modify shell
-G adds a user to the group
-L Lock User
-U Unlock User
Note: Passwd-l is also a lock user
Passwd-u is also unlocking the user
Passwd-l Lock the user, in the/etc/passwd can see the locked user password in front of two!
Usermod-l Lock the user, in/etc/passwd can see the password is locked before the user is a!.
Unlock the user with usermod-u, unlock!!, need to be unlocked two times.
Unlock the user with passwd-u, unlock!!, once and then OK.
CHFN Username Modify User's description information
Example: hua:x:500:500:huhu,11111,1111,1111:/home/hua:/bin/bash
Password Management:
/ETC/PASSWD configuration information for users
①shan:②x:③501:④501:⑤:⑥/home/shan:⑦/bin/bash
① User Name
② User Password
③uid
④gid
⑤ description information about the user, CHFN username can be used to add descriptive information
⑥ User's home directory
⑦ User's shell environment
/etc/shadow User Password configuration information
①shan:②$6$v4bjzenc$apntkkchk0a/1i7oakx0oykiy2. Nprxx23xlzd09omfyrwq3yx6jnxst9va.4g8.jst.jxmh8zcyvem/bl6w.:③16699:④0:⑤99999:⑥7:⑦:⑧:⑨
① User Name
② password, this is an encrypted password, $6 represents sha-512,$5 on behalf of the SHA-256,$1 representative MD5.
③ the last date the password was modified, expressed as the number of days from January 1, 1970.
④ the number of days from which a password can be changed, 0 means no limit and can be changed at any time.
⑤ the maximum number of days that a password must be changed
⑥ number of days before the account expires in advance warning
⑦ the number of days that a user can still be used after a password expires
⑧ account expiration date, expressed as the number of days from January 1, 1970.
⑨ reserved for future use
This article is from the "My Linux Road" blog, so be sure to keep this source http://8641765.blog.51cto.com/8631765/1696672
My Linux path----user and group and password management