1753726 Members
4776 Online
108799 Solutions
New Discussion юеВ

sudo problem..

 
srinu_1
Frequent Advisor

sudo problem..

Hi all,
I have given the following entry in the visudo file.

# %users localhost=/sbin/shutdown -h now
srinu ALL=NOPASSWD:IFCONFIG

But still it's asking for the passwd.
what is the problem.is this entry wrong?.

Thanks
srinu.
2 REPLIES 2
Michael Steele_2
Honored Contributor

Re: sudo problem..

Here's a link to visudo and I've pasted in some trouble shooting tips:

http://www.courtesan.com/sudo/man/visudo.html#diagnostics

DIAGNOSTICS
sudoers file busy, try again later.

Someone else is currently editing the sudoers file.

/etc/sudoers.tmp: Permission denied

You didn't run visudo as root.

Can't find you in the passwd database

Your userid does not appear in the system passwd file.

Warning: undeclared Alias referenced near ...

Either you are using a {User,Runas,Host,Cmnd}_Alias before defining it or you have a user or hostname listed that consists solely of uppercase letters, digits, and the underscore ('_') character. If the latter, you can ignore the warnings (sudo will not complain). In -s (strict) mode these are errors, not warnings.

Warning: runas_default set after old value is in use ...

You have a runas_default Defaults setting listed in the sudoers file after its value has already been used. This means that entries prior to the runas_default setting will match based on the default value of runas_default (root) whereas entries after the runas_default setting will match based on the new value. This is usually unintentional and in most cases the setting should be placed before any Runas_Alias or User specifications. In -s (strict) mode this is an error, not a warning.
Support Fatherhood - Stop Family Law
Kurt Boyack
Occasional Advisor

Re: sudo problem..


Try removing the "#".

Also, you can use /etc/shutdown.allow to specify users who are allowed to shutdown the system.