The error "username is not in the sudoers file. This incident will be reported" appears in Ubuntu. Please tusudoers

Source: Internet
Author: User

The error "username is not in the sudoers file. This incident will be reported" appears in Ubuntu. Please tusudoers

Reference Web site http://www.maketecheasier.com/fixing-sudo-error-in-ubuntu/

In Ubuntu Linux:

When learning laruence's private dish, I used the following command:

<span style="font-size:18px;">usermod -G users username</span>

Username is your username.

Because the-a parameter is not used, my user is divided into the users user group, and the original user group is reset, only the users user group is left.

The sudo command cannot be used because there is no sudo user group.

Solution: reboot system on the x-windows GUI

Go to the grub page and select the selected items.

Select fsck and wait about 30 seconds.

Click "root" to enter the command line under "root ".

Enter

<span style="font-size:18px;">usermod -a -G sudo usernameusermod -a -G adm username</span>

Some systems are admin, but my system is adm. However, I have read that admin is used in the sudoers file,

Admin is not included in my/etc/group, so I cannot allow my users to use sudo when I add adm. Therefore, I still need to join the sudo user group.

<span style="font-size:18px;">## This file MUST be edited with the 'visudo' command as root.## Please consider adding local content in /etc/sudoers.d/ instead of# directly modifying this file.## See the man page for details on how to write a sudoers file.#Defaults        env_reset # Host alias specification # User alias specification # Cmnd alias specification # User privilege specificationroot    ALL=(ALL:ALL) ALL # Members of the admin group may gain root privileges%admin ALL=(ALL) ALL # Allow members of group sudo to execute any command%sudo   ALL=(ALL:ALL) ALL #includedir /etc/sudoers.d</span>

Click resume to restart the system.

After restarting, you can enter root.

If you can directly use the su-command to directly access the super root user, you can directly modify the/etc/sudoers file.

Modify the user group to which the username user belongs.




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.