In this tutorial, I will show you how to fix "USER is not in the sudoers file. This incident will be reported." on Redhat 7 ...
In Linux OS root is the Super user and having all rights to achieve anything either good or bad.
It is locked by default for the normal users and you will get the error "users is not in sudoers file" if you try to switch as root
Type visudo in terminal and search for the below line
Step 3: Add your username to the sudoers file
- adminpc is my username
Step 4: Save and exit the file and try to switch as root
It is locked by default for the normal users and you will get the error "users is not in sudoers file" if you try to switch as root
How to fix USER is not in the sudoers file?
Step 1: Login as rootsu (or) su -Step 2: Edit the visudo file
Type visudo in terminal and search for the below line
root ALL=(ALL) ALL
Step 3: Add your username to the sudoers file
username ALL=(ALL) ALL
- adminpc is my username
Step 4: Save and exit the file and try to switch as root
COMMENTS