[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: sudo does not respond to settings in /etc/sudoers



On Sat, 14 Nov 2015 13:20:19 -0500
Ric Moore <wayward4now@gmail.com> wrote:

> On 11/14/2015 09:36 AM, Mario Castelán Castro wrote:
> > El 14/11/15 a las 02:11, Ken Heard escribió:  
> >> -----BEGIN PGP SIGNED MESSAGE-----
> >> Hash: SHA1
> >>
> >> In my Wheezy box I want to be able to run any root command as my
> >> user without having to enter a password to do so.  I assume that
> >> there are two ways to do so: either make my user a member of the
> >> sudo group, or add a line to sudoers giving such privileges to my
> >> user.  Neither worked.  
> >
> > You have to add the "NOPASSWD" option. Check the "sudoers" man
> > page.  
> 
> Add your user to the sudo group like this in /etc/group :
> sudo:x:27:ric
> ...using your own user name. Then it will work, if you added your
> user to /ect/sudoers like:
> # User privilege specification
> root	ALL=(ALL:ALL) ALL
> ric	ALL=(ALL:ALL) ALL
> 
> 
> ...works for me(tm)  :)Ric
> 
> 
> 

The OP did explicitly say he wanted to use the NOPASSWD option, and his
sudoers file shows it in use, currently commented. Your example will
still ask for a password, and anyway it's either/or: you can either add
yourself to the sudo group or add your name to sudoers, you don't need
both. The sudo group is just a quick and simple way of giving the same
set of [presumably low-level] privileges to a number of people, and
the sudo sudoers entry really shouldn't be NOPASSWD, as by default it
gives full root privileges.

I don't use NOPASSWD myself, so I can't give a definitive answer (as
in 'this works for me') to the question, but presumably there's a
semantic issue somewhere. Visudo can only pick up syntax errors, it
can't tell what you meant to achieve. 

-- 
Joe


Reply to: