Linux Learning Summary (16) system user and user group management

Source: Internet
Author: User

Get to know two files first
/etc/passwd
/etc/shadow

We print out three lines to understand the following:
Each line consists of: Split into 7 segments, each paragraph meaning:
First paragraph: User name, such as root user, ordinary user test,lv,test1
The second paragraph: early storage account login password, due to security factors, now stored in the/etc/shadow, now with X instead of
The third paragraph: UID, user representation number, the system through this number to identify the user identity, 0 for the root,1-499 system reserved, as a management account, the average user starting from 500
Fourth paragraph: GID, user group identification number
Fifth: Note that the field does not make sense and usually records some of the user's attributes, such as name, phone, address, etc.
The sixth paragraph: the user's home directory, you can define
Seventh: Shell, after the user logs on to start a process to the user issued instructions to the kernel
and see/etc/shadow.

Also used: Split into 9 paragraphs, each meaning:
1. User Name
2 User Password
3 Date The password was last changed
4 How many geniuses can you change your password, which is 0 by default, without limiting
5 Number of days after the password expires, the default value is large enough to understand that it will not expire
6 Prompt before password expires, default is 7, reminder user one week before password expires, password expires in one week
7 account lockout period, such as set to 3, meaning that the password has expired, the user did not change the password before expiration, and three days account will be locked
8 account life cycle, expire account after expiry
9 reserved fields, no actual meaning

Useradd Add Account

Format: Useradd parameter user name
-U definition UID
-g Specifies GID the user group must exist, can be a group name, or can be a GID number
-D Definition Home Directory
-S definition shell
Userdel Deleting an account
Format: Userdel parameter user name
-R Delete Home directory while deleting account

Groupadd Add Group

Format Groupadd parameter group name
-G Specify GID
Groupdel Deleting a group
Format: Groupdel Group name
Usermod Modifying account information
Format usermod parameter new information user name
For example: Usermod-u 510 test Change the test user UID to 510
-U Modify User
-G Modify User Group
-D Modify Home directory
-S Modify shell

passwd Change your account password

This command has been introduced many times before, passwd without any parameters, meaning to modify the current login user's password, for ordinary users, you must enter the old password to change. The root user can reset the password of the normal user with the passwd followed by the user name
MKPASSWD Generating Random passwords
-L Specify Password length
-s Specifies the number of special characters
-d Specify number of digits
The system does not have this command and can be installed with Yum Install-y expect

Linux Learning Summary (16) system user and user group management

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.