I've created a user noc and gave it a permission to run with sudo. I've added the following lines to the sudoers file.
Cmnd_Alias NOC = /etc/init.d/tomcat noc ALL=(ALL) NOPASSWD: NOC
Problem is that when I try run
sudo /etc/init.d/tomcat status on machine A
it says: "noc is not in the sudoers file. This incident will be reported"
but I run the same command with same configuration on machine B, it works fine.
things I've checked:
- sudoers file permission is set to 0440
- all lines in sudoers file on both machines are the exact same
I have CentOS 6.8 with latest updates installed.