March 2009
M T W T F S S
« Feb   Apr »
 1
2345678
9101112131415
16171819202122
23242526272829
3031  

Sudo without password problems on kubuntu?

I needed an account that have the ability to get root privileges for running certain scripts without requesting for a password -it’s an unatended process-, so as you know the best way to do this on GNU/LiNUX is “sudo” command. To set up this, on kubuntu -and other ubuntu variants, and surely other distributions- there’s a file called “/etc/sudoers”, where you can stablish what sytem users/groups can use sudo and how.

In kubuntu there’s a line, usually commented, like this:

# Uncomment to allow members of group sudo to not need a password
%sudo ALL=NOPASSWD: ALL

You may think that uncommented that line is enough, I thought that, but it wasn’t. Afther a few minutes thinking about it, I realize that I’ve another uncommented line below that says:

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

And my user was on both, sudo and admin groups. So I just inverted the order of those lines, putting first the one about “admin” group, and after the one about “sudo” group. And it works.

So remember that in case of conflict, the last entry of “sudoers” file is the one that count.

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

CAPTCHA image