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

[boobalan@centos ~]$ sudo su

[sudo] password for boobalan:

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

[boobalan@centos ~]$ su

Password:

[root@centos boobalan]# 


//sudo su is not working instead su is working 

//make sure the user name is present in sudoers config file with All privilege 

[root@centos boobalan]# visudo

//added below line, i think this is not work

#myself added sudo
%sudo   ALL=(ALL:ALL) ALL

## Read drop-in files from /etc/sudoers.d (the # here does not mean a comment)
#includedir /etc/sudoers.d

//or ignore this line. check the sudo package are installed or not then install it.

[root@centos ~]# yum install sudo
Last metadata expiration check: 1:53:10 ago on Thu 19 Aug 2021 01:10:22 AM PDT.
Package sudo-1.8.29-7.el8.x86_64 is already installed.
Dependencies resolved.
Nothing to do.
Complete!

//if it centos then sudo work only on the wheel group members
[root@centos ~]# usermod -aG wheel username





Post a Comment

1 Comments