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