Solution for user is not in sudoers file when sudo is used

Source: Internet
Author: User

In Linux, this error is often reported when a common user uses sudo, for example:
[Oracle @ DBA2 fd] $ sudo ps-ef | grep dbw
[Sudo] password for oracle:
Oracle is not in the sudoers file. This incident will be reported.
[Oracle @ DBA2 fd] $
The error is reported because the user oracle is not in The sudo configuration file, and the oracle user has no permission to use sudo;
 
Solution:
You can modify the attribute of the/ete/sudoer file as root by using the root user, and add oracle ALL under the root ALL line (similar to the root line)
[Root @ DBA2 etc] # chmod u + w sudoers
[Root @ DBA2 etc] # vi sudoers
Add oracle ALL = (ALL) ALL
 
Change the sudoer attribute back to the original value:
[Root @ DBA2 etc] # chmod u-w sudoers
[Root @ DBA2 etc] # ll sudoers
-R -- r ----- 1 root 3402 Sep 4 10:40 sudoers
 
Try the sudo command again. You can use it;
[Oracle @ DBA2 ~] $ Sudo ps-ef | grep dbw
[Sudo] password for oracle:
Oracle 3140 1 0? 00:00:06 ora_dbw0_orcl2
Oracle 19299 17065 0 00:00:00 pts/2 grep dbw

Recommended reading:

Use and enable the root account with Ubuntu sudo and su commands

Sudo: sorry, you must have a tty to run sudo

Configure sudo permissions in Linux

Temporary root permission for sudo Configuration

How to solve the problem that users cannot execute sudo in Linux

The Linux system administrator must not know the command: sudo

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.