Introduction to user and group management commands in Linux

Source: Internet
Author: User

Introduction to user and group management commands in Linux

Configuration files for users and groups in Linux mainly include passwd, shadow, group, and gshadow. The passwd user saves the user's account information and is readable to any user; The shadow detachment root user is readable; the group is a means to control the permissions of user groups, this file can be read by any user. gshadow is used to define the user's group password and Group Administrator information.

Common User management commands:

Add the user's command: useradd-u UID-g group name-d/home/group name-s/bin/bsh-e 2011/1/1 (expiration time) User Name (zhang)

Command to delete a user: userdel-r username

Modify the attributes of a user's account: usermod-l newusername username change the existing user name

Lock the specified username: usermod-L username

Unlock the Locked User: usermod-U username

Change User Password: passwd Password

Passwd related operations

Passwd-S username is used to query the status of the specified user's password, only available to the root user

Passwd-l username: the user locks the specified user

Passwd-u username user to unlock the relevant user

Passwd-d username is used to delete the password of a specified user, which is only available to the root user.

Related Management commands for group accounts:

Groupadd-r group name

Groupdel-r group name

Groupmod-r group name (Change Group attributes)

Command for gpasswd: the user adds or deletes the specified user from the group.

Command Format: gpasswd [parameter] user name group name

Gpasswd-a username groupname adds the specified user to the specified user group.

Gpasswd-d username groupname: delete a specified user from the group

Gpasswd-A usernmae groupname: Specify the specified user as the Group Administrator.

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.