Linux Add users and Groups

Source: Internet
Author: User

User:
1. Only the root user or a user with root privileges can operate
Add User: Useradd Xiaol
Set Password: passwd xiaol
Delete User: Userdel Xiaol
Delete User and home directory: Userdel-r Xiaol
2. After the user is successfully added, a directory with the word XIAOL will be created automatically under/home as the Xiaol user's main directory
3. When the login is successful with Xiaol, it will automatically enter its own home directory.


Group
1. Add Group: Groupadd Group name
Groupadd gp_1
2. Assigning groups when creating a user: Useradd-g group name User name
Useradd-g gp_1 Xiaol_1
3. Modify the user's group: USERMOD-G Group name User name
Usermod-g Root Xiaol_1

Information for users and groups:
1. View information for all groups in Linux
Cat/etc/group
2. View all user information in Linux
cat/etc/passwd

Linux Add users and Groups

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.