Linux User management commands for the NBA edition

Source: Internet
Author: User

User management commands for the NBA edition

This article is purely nonsense, if there is not strict, but also please Haihan.

1 Groupadd

Role: Create a genus group format: groupadd [options] A group name option:-: Empty option Create new genus Group,-G: Specify group GID, default is gid+1

Instance

1.1 Adding a group team, specifying a group ID of 1111 groupadd-g 1111 Team

2 Groupmod

Function: Modify the genus Group Information format: groupmod [options] Genus group Name option:-g:gid Modify Genus Group Gid-n: Modify Genus Group Name

Instance

2.1 Modify GID to 2222 groupmod-g 2222 team2.2 modify genus group named Team_new groupmod-n team_new Team

3.groupdel

Function: Delete the genus group format: groupdel [option] is a group name option:

Instance

3.1 Delete Genus Team_new Groupdel team_new

4 Useradd

Role: Add new users and user information. Format: useradd [options] Username option:-: Option to create a new user without default information-u: Specify the user's id-g: Specify the base group ID, this group must exist beforehand-G: Specify additional groups, and multiple groups separated by commas-s: Specify user she LL Environment

Instance

4.1  Create user Cavaliers, information for default information     useradd cavaliers    4.2  Create the User Warriors and specify the ID number 1024     useradd -u 1024  warriors     4.3  Create user spurs, specify User ID 1026, specify user's base group as team    groupadd team     useradd -u 1026 -g team spurs    4.4  Create user Lakers, Specifies the user's ID is 1033, the specified user's base group is superstar, and the specified user's additional group is coach,player    groupadd superstar     groupad coach    groupad player    useradd  -u 1033 -g superstar -g coach,player lakers 

5 Usermod

Role: Modify user and user information. Format: usermod [options] User name options:-U: Modify the user's Id-g: Modify the base group ID, this ID belongs to the group prior to the existence of G: modify additional groups, multiple groups separated by commas. The original group will be overwritten-a-g: Add additional groups, the original group will not be overwritten with-s: Modify user Shell Environment-L: Lock User-u: Unlock user

instance

5.1  Modify the user Warrior's ID to 10000     usermod -u 10000  warriors     5.2  Modify the user's Spurs ID and basic group     usermod -u 10001 -g  superstar spurs    5.3  Modify the user's Spurs ID, Base group, and additional group     usermod - u 10002 -g coach -g superstar,player  spurs    5.4   Lock users and unlock users     usermod -l spurs    usermod -u  spurs 

6 Userdel

Role: Delete user information and related files. Format: usermod [options] User name option:-r: Delete User information and delete user home directory

Instance

6.1 Delete user Spurs Userdel Spurs

7 Summary of Commands and additions

7.1 groupadd Add Genus Group 7.2 groupmod modify genus Group information 7.3 Groupdel Delete genus Group 7.4 useradd Add User (owner) 7.5 usermod Modify User (owner) Information 7.6 Userdel Delete User (owner) Information 7.7 I D Displays the user's actual ID valid ID
instances [[email protected] nba]# ID spursuid=10002 (spurs) gid=2225 (coach) groups=2225 (coach), 2224 (Superstar), 2226 (player)


This article from the "12450987" blog, reproduced please contact the author!

Linux User management commands for the NBA edition

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.