1, add the user, first with the AddUser command to add a normal user, the command is as follows:
#adduser Tommy
Add a user named Tommy
#passwd Tommy//Change Password
Changing password for user Tommy.
New UNIX Password://Enter your password here
Retype new UNIX Password://Enter password again
Passwd:all authentication tokens updated successfully.
2. Delete User test:
Userdel Test
To delete users and user directories:
Userdel-f Test
XXX is not in the sudoers file. This incident would be reported. Solution
1. Switch to the root user, how to switch it needless to say, will not be Baidu to go.
2. Add the Write permission to the sudo file, and the command is:
chmod u+w/etc/sudoers
3. Edit the 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) all
Youuser 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.
CentOS Add and remove users and XXX is not in the sudoers file. This incident would be reported. Solution