Groupadd-g 1005 Dev
Add user group specify GID to 1005
Delete user Group Dev
Add user
AddUser Mike
will automatically prompt you to enter a password, etc.
</pre><pre name= "code" class= "plain" >useradd simael-u 600-g 1005-s/bin/bash
-u Specifies UID (System reserved 0-499)-g Specifies the shell used by the user group-s
and then
Set a password for a user
Delete User
Userdel Mike
If you are prompted to log off the user by skill
Skill-kill-u Mike
Logoff Mike User
To view all users and user groups:
Cat/etc/passwdcat/etc/group
To add permissions to the user that can use the sudo command
To add write permissions to the sudo file, the command is:
chmod u+w/etc/sudoers
Edit Sudoers File
Vi/etc/sudoers
Find this line root all= (all) all, add the following to him xxx all= (all) all (here xxx is your user name)
PS: Here you can sudoers add any one of the following four lines
Youuser all= (All) all%youuser all= (All) allyouuser all= (All) Nopasswd:all%youuser All= (All) Nopasswd:all
First line: Allows the user to execute the sudo command youuser (requires a password).
Second line: Allow user group Youuser inside user to execute sudo command (need to enter password).
Line three: Allow the user to execute the sudo command youuser, and do not enter a password at the time of execution.
Line four: Allow user group Youuser inside user to execute sudo command, and do not enter password at execution time.
4. Revoke sudoers file Write permission, command:
chmod u-w/etc/sudoers
This makes it possible for ordinary users to use sudo.
--------------------------------------------------------------------------------
ID-U Displays the UID of the current user
ID-G displays the GID of the current user
Look at the contents of/etc/passwd, the 4th item in each line is GroupID, and the fifth item is USR ID Info, similar to the group name. With Vim,grep, you can quickly find the row where the specified user is located. Be familiar with awk and write a script.
grep mike/etc/passwd|awk-f: ' {print $} '
Ubuntu user Add Add sudo permission Group Add clutter Overview