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