/etc/sudoers problem, config works on machine B, but not on A

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












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.







share|improve this question





















  • I'm not sure if necessary, but did you log out then back in with noc?
    – Sparhawk
    Jul 5 at 6:15






  • 1




    Related - askubuntu.com/questions/665950/….
    – slm♦
    Jul 5 at 6:21






  • 1




    have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
    – steve
    Jul 5 at 6:43










  • yes user is truely there
    – Ali Golestan
    Jul 5 at 6:50










  • sdiff the 2 files b/w the 2 servers and double check that they're not different.
    – slm♦
    Jul 5 at 9:49














up vote
0
down vote

favorite












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.







share|improve this question





















  • I'm not sure if necessary, but did you log out then back in with noc?
    – Sparhawk
    Jul 5 at 6:15






  • 1




    Related - askubuntu.com/questions/665950/….
    – slm♦
    Jul 5 at 6:21






  • 1




    have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
    – steve
    Jul 5 at 6:43










  • yes user is truely there
    – Ali Golestan
    Jul 5 at 6:50










  • sdiff the 2 files b/w the 2 servers and double check that they're not different.
    – slm♦
    Jul 5 at 9:49












up vote
0
down vote

favorite









up vote
0
down vote

favorite











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.







share|improve this question













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.









share|improve this question












share|improve this question




share|improve this question








edited Jul 5 at 9:48









slm♦

233k65479651




233k65479651









asked Jul 5 at 5:46









Ali Golestan

130212




130212











  • I'm not sure if necessary, but did you log out then back in with noc?
    – Sparhawk
    Jul 5 at 6:15






  • 1




    Related - askubuntu.com/questions/665950/….
    – slm♦
    Jul 5 at 6:21






  • 1




    have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
    – steve
    Jul 5 at 6:43










  • yes user is truely there
    – Ali Golestan
    Jul 5 at 6:50










  • sdiff the 2 files b/w the 2 servers and double check that they're not different.
    – slm♦
    Jul 5 at 9:49
















  • I'm not sure if necessary, but did you log out then back in with noc?
    – Sparhawk
    Jul 5 at 6:15






  • 1




    Related - askubuntu.com/questions/665950/….
    – slm♦
    Jul 5 at 6:21






  • 1




    have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
    – steve
    Jul 5 at 6:43










  • yes user is truely there
    – Ali Golestan
    Jul 5 at 6:50










  • sdiff the 2 files b/w the 2 servers and double check that they're not different.
    – slm♦
    Jul 5 at 9:49















I'm not sure if necessary, but did you log out then back in with noc?
– Sparhawk
Jul 5 at 6:15




I'm not sure if necessary, but did you log out then back in with noc?
– Sparhawk
Jul 5 at 6:15




1




1




Related - askubuntu.com/questions/665950/….
– slm♦
Jul 5 at 6:21




Related - askubuntu.com/questions/665950/….
– slm♦
Jul 5 at 6:21




1




1




have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
– steve
Jul 5 at 6:43




have you run sudo -l as user noc, to make sure the sudo rule is truly there ?
– steve
Jul 5 at 6:43












yes user is truely there
– Ali Golestan
Jul 5 at 6:50




yes user is truely there
– Ali Golestan
Jul 5 at 6:50












sdiff the 2 files b/w the 2 servers and double check that they're not different.
– slm♦
Jul 5 at 9:49




sdiff the 2 files b/w the 2 servers and double check that they're not different.
– slm♦
Jul 5 at 9:49















active

oldest

votes











Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);








 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453531%2fetc-sudoers-problem-config-works-on-machine-b-but-not-on-a%23new-answer', 'question_page');

);

Post as a guest



































active

oldest

votes













active

oldest

votes









active

oldest

votes






active

oldest

votes










 

draft saved


draft discarded


























 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f453531%2fetc-sudoers-problem-config-works-on-machine-b-but-not-on-a%23new-answer', 'question_page');

);

Post as a guest













































































Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?