Xxx is not in the sudoers file. This incident will be reported Solution

Source: Internet
Author: User

When running the sudo command on Linux, the following error is reported: xxx is not in the sudoers file. This incident will be reported.
This problem occurs because the user executing the sudo command is not in the sudoers file list. You can solve this problem by editing the sudoers file.

There are two ways to edit the sudoers file: one is to execute vi sudo with the root account, and the other is to execute vi/etc/sudoers with the root account. In fact, both are to modify/etc/sudoers.
Assume that your user name is "tuzhu" and belongs to the "tuzhu" user group.
To enable user tuzhu to execute sudo, you can add any row of four rows in the sudoers file.

Tuzhu ALL = (ALL) ALL % tuzhu ALL = (ALL) ALL tuzhu ALL = (ALL) NOPASSWD: ALL (this setting is recommended for convenience) % tuzhu ALL = (ALL) NOPASSWD: ALL
Note:
Line 1: allow the user tuzhu to execute the sudo command (password required ).
Line 2: Allow users in the tuzhu user group to execute the sudo command (password required ).
Line 3: allow the user tuzhui to execute the sudo command without entering the password during execution.
Row 4: Allow users in the tuzhu user group to execute the sudo command without entering the password during execution.
Of course, if you understand the above principle, you can directly enter the following command to solve this problem
Su-echo 'xxx ALL = (ALL) all'>/etc/sudoers (xxx indicates the user name)

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.