1834346 Members
1832 Online
110066 Solutions
New Discussion

Re: Help on Sudo

 
Mehmood Ansari
Frequent Advisor

Help on Sudo

Hi

I am new to sudo and I need help urgently to run sudo. One of our friend help me, but still I am facing problem. Please help me exactly how do define the parameters for sudo. I did the following with the help of Jose.

1. visudo I added the following:-

Cmnd_Alias FBACKUP=usr/sbin/fbackup
Cmnd_Alias FRECOVER=/usr/sbin/frecover
Cmnd_Alias SDOWN=/usr/sbin/shutdown -r now

Host_Alias MYHOSTS=cmsoper
cmsoper (ALL) NOPASSWD:ALL
%cmsoper MYHOSTS=NOPASSWD:FBACKUP,FRECOVER,SDOWN


When I execute from /home/cmsoper the massage is :-

[cmsprod,cmsoper,ORCL,/home/cmsoper]>/usr/local/sbin/visudo
/usr/local/sbin/visudo: /usr/local/etc/sudo/sudoers: Permission denied

Urgent help is needed
Regards

3 REPLIES 3
Nick Wickens
Respected Contributor

Re: Help on Sudo

Hi

Not sure about that Host_Alias entry ? - Is cmsoper also your hostname as well as the user ?

Might also be worth leaving the % off of the user line to see if thats causing problems.
Hats ? We don't need no stinkin' hats !!
Mehmood Ansari
Frequent Advisor

Re: Help on Sudo

Hi

This is typing mistake actuall Host is [cmsprod] and [cmsoper] is user. I did removed % and tried, same problem permission denied.

Jose Mosquera
Honored Contributor

Re: Help on Sudo

Hi again,

Why you have jumped from the original posted request; http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=613657

Have you done the last steps indicated indicated? Pls check!

By the way, % mean a group, for this you must have a group into /etc/group containing users to give privileges.

Rgds.