Basic Linux Tutorials---user and group actions

Source: Internet
Author: User

User and group actions

The Linux operating system is stable, secure, and its "user and group" management is inseparable, I first look at the real life of the project group of Simple management:

The task of setting permissions for the user to manipulate files is cumbersome and not implemented.

When Linux creates a user, it will consider the creation of a group system to add and subtract files, but also a file into a group inside

So that the system administrator only need to care about the user is that group , you can know what the user specific file operation permissions.

User and group operations for Linux:

1. Group Operations (/etc/group)

① Add Group information Groupadd (there is no space attached to the write)

># Groupadd grouname//Create a group

② modifying the name of a group

># groupmod-g Group number-N new name GroupName

③ Delete Group (if there is user information under Group, delete is forbidden)

># Groupdel Group Name

2. User Action (/etc/passwd)

① Add user Useradd

USERADD-G group number-u user number-D User home directory username

># useradd username//Create an ordinary user without setting the user group information, create a group with the same name as the user name

> # useradd-g Group number username// Create A user while the Its group settings ( This will not Create the same name Group )

Exercise: Use the root account to add a group ID of 505 User ID 510 home directory under/var/xueyou users xueyou

② User Modify operation (group, ID, home directory) users Modify

USERMOD-G group number-u user number-D home directory-L newname username

># usermod-g GID username//Modify user group number information (common)

③ User Delete

># Userdel User name//delete user

># userdel-r username//delete user at the same time, also delete user home directory

④ setting a password for the specified user

PDF file Download:

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Basic Linux Tutorials---user and group actions

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: 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.