Linux Series notes-user and user group commands

Source: Internet
Author: User

First, preface

This series of essay notes is not a detailed description of the principles of the command, just a simple record,

For later review and review

Second, direct input command problem

Sometimes, when we use Useradd Groupadd and other commands, directly at the terminal input, will prompt, no this command or command does not exist message

This is because the commands we enter directly are the commands in the/usr/bin directory, and our Useradd groupadd command is in the/usr/sbin directory

Therefore, there are two ways to solve the problem:

1. Under the/usr/sbin directory, run the appropriate command to

2. Create a soft link

Ln-s/usr/sbin/groupadd/usr/bin/groupadd

So you can use the Groupadd command directly.

Third, user and user group commands
1. Add user group Groupadd test11//  establish TEST11 user Group Groupadd-g 507 test11//  establish TEST11 user group, and specify user group ID number cat/etc/group   // View information about a user group 2. Add User useradd-d/home/test11-g 506-m test11//Add new user belongs to 506 user group and create home directory/home/test11cat/etc/passwd  //View user Information 3 . Set the password for the user passwd test11//Set a password for the user, then enter two times to determine the Cat/etc/shadow   //user password file 4. Modify user Information Usermod-g 508 test11  //Modify the group to which the user belongs 508 Usermod-a-G groupa user   //Users add to Groupa without leaving legacy Group usermod-h//view Help files 5. Delete User Userdel  test11//delete/etc/gro  up/etc/passwd  /etc/shadow record userdel-r  test11//delete the above record, delete the main directory 6. Modify user groups Groupmod-g 102   // User group test11 identification number, becomes 102 groupmod-h  //View Help file 7. Delete user group Groupdel test11  //delete test11 user group

  

Linux Series notes-user and user group commands

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.