"1" Analysis problem
The prompt content translates into Chinese namely: User xxx (generally the newly added user name) does not have permission to use sudo.
Workaround Modify the permissions of the new user by modifying the/etc/sudoers file.
"2" switch to root user mode
Command: Su-
Note: This command has a "-", which is different from Su.
When using the command "su" just switch to root, but not the root environment variable passed, or the current user's environment variables.
Using the "Su-" command will also switch the environment variables in the past (can be tested, two commands to see the environment variable $path), as if the root login.
"3" Modify the Write permission of the file
Command: chmod u+w/etc/sudoers
"4" Edit file contents
Command: Gedit/etc/sudoers
After opening the file, look for root all= (all) all this line
Add a line below this line:
XXX all= (All) all
where xxx is the user name. Remember to save.
"5" revoke write permission for the file
Command: chmod u-w/etc/sudoers
"6" validation issue. Switch to User xxx
Command: Su XXX
Enter the password for the user. The sudo command can be used normally.
Good good study,day day up.
Sequential Selection Cycle Summary
UBuntu sudo command: XXX isn't in the sudoers file. This incident would be reported.