root sudo fails with the error : "root is not in the sudoers file. This incident will be reported"
Issue
Following command was executed as root and it failed with an error :
[root@host]sudo -u test vi /var/log/messages
root is not in the sudoers file. This incident will be reported.
Running the same command as a normal user was successful.
[anotheruser@host]sudo -u test vi /var/log/messages
Environment
- Red Hat Enterprise Linux 4,5,6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.