PDA

View Full Version : [ubuntu] visudo


easoukenka
September 16th, 2009, 12:47 AM
For some reason my ability to sudo without password for some commands has quit working. It appears to be after the update last night that had me reboot but I am not certain.


Thank you in advance for any assistance.

root@asoukenka:/home/asoukenka# visudo


# /etc/sudoers
#
# This file MUST be edited with the 'visudo' command as root.
#
# See the man page for details on how to write a sudoers file.
#


Defaults env_reset

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL) ALL

# Uncomment to allow members of group sudo to not need a password
# (Note that later entries override this, so you might need to move
# it further down)
# %sudo ALL=NOPASSWD: ALL
%admin ALL=(ALL) ALL
#asoukenka ALL=NOPASSWD: /usr/sbin/bandwidthd, /sbin/swapoff, /sbin/swapon
asoukenka ALL=(ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL



asoukenka@asoukenka:~$ sudo /usr/sbin/bandwidthd
[sudo] password for asoukenka:

Lars Noodén
September 16th, 2009, 12:00 PM
#asoukenka ALL=NOPASSWD: /usr/sbin/bandwidthd, /sbin/swapoff, /sbin/swapon


Can't say the reason the sudoers file got that way, but if those are the programs you wish to run with sudo but without a password, then uncomment the line.
Right now it's the same as not being there.

easoukenka
September 16th, 2009, 01:23 PM
While testing i removed that line and added

asoukenka ALL=(ALL) ALL

Which means allow all programs. I did this just for testing because the other line was not working either all of the sudden

bodhi.zazen
September 16th, 2009, 06:38 PM
You do not have any user or group configured to sudo without a password currently.

easoukenka
September 17th, 2009, 12:27 AM
Ok I understand what you are saying the line I added was incorrect. However the line that was commented was my origonal line that stopped working. However after a reboot now the old line is working now.

I'm not crazy though the only reason I modified this file was some scripts stopped running that have always run so I just tryed that other line for testing.

Thank you all for your support

bodhi.zazen
September 17th, 2009, 12:44 AM
Strange things happen if a user is specified more then once in /etc/sudoers

So you specified your user once, I assume, as your user is in the admin group

and a second time by user name :(

In theory , the FIRST instance is applied to your user (%admin) , and the second is ignored.