You are not logged in.

#1 2010-03-04 21:54:30

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

[SOLVED] Sudoers Help

I've been looking into this and I can't see what's wrong. It's probably something obvious.
I've checked the wiki, the man page and various tutorials, but well, here we are. I'm sure I'm missing something that's there in black and white (or at least font colour and background colour), but I can't see it.

I'm in group wheel.
All defaults are unchanged and these are the only entries in sudoers (I've cut out the comments etc.)

 
root   ALL=(ALL) ALL
me    ALL=(ALL) NOPASSWD: /usr/bin/rebase
me    ALL=(ALL) NOPASSWD: /sbin/shutdown

%wheel ALL=(ALL) ALL

Running:

sudo shutdown -r now
sudo /usr/bin/rebase

still asks me for my password.

Can someone tell me the reason, please?

Last edited by skanky (2010-03-04 22:25:33)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#2 2010-03-04 21:57:55

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,424
Website

Re: [SOLVED] Sudoers Help

My sudoer entry is slightly different (and it works):

jason Longbow=NOPASSWD: /sbin/shutdown -h now

(Longbow is hostname of this machine)

#edit which doesn't actually answer your question, but may help in some way (I hope)...

Last edited by jasonwryan (2010-03-04 21:58:44)


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#3 2010-03-04 22:04:25

bernarcher
Forum Fellow
From: Germany
Registered: 2009-02-17
Posts: 2,281

Re: [SOLVED] Sudoers Help

This is, what I have. Note the "%wheel" comment.

# Shutdown privileges (must come after %wheel)
<user>      ALL=NOPASSWD: /sbin/reboot
<user>      ALL=NOPASSWD: /sbin/halt

The "<user>" of course is the user id to which these privileges apply.


To know or not to know ...
... the questions remain forever.

Offline

#4 2010-03-04 22:07:27

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Sudoers Help

Thanks I'll try changing to <host>=NOPASSWD: <cmd> and see if that works (takes a while to test with the five min timeout - which I could change I realise).


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#5 2010-03-04 22:11:53

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Sudoers Help

bernarcher wrote:

This is, what I have. Note the "%wheel" comment.

# Shutdown privileges (must come after %wheel)
<user>      ALL=NOPASSWD: /sbin/reboot
<user>      ALL=NOPASSWD: /sbin/halt

The "<user>" of course is the user id to which these privileges apply.

Aha, thanks that could be the issue. I did wonder, but for some reason the wheel definition was last in my file (that could have been me when I installed the machine though, come to think of it).

Note: my previous post was in reply to jasonwryan.


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

#6 2010-03-04 22:16:17

brisbin33
Member
From: boston, ma
Registered: 2008-07-24
Posts: 1,796
Website

Re: [SOLVED] Sudoers Help

i have the following:

# User privilege specification
root    ALL=(ALL) ALL
patrick ALL=(ALL) ALL
patrick ALL=(ALL) NOPASSWD: /usr/bin/pacman
patrick ALL=(ALL) NOPASSWD: /usr/bin/pacman-color
patrick ALL=(ALL) NOPASSWD: /sbin/telinit
patrick ALL=(ALL) NOPASSWD: /sbin/shutdown
patrick ALL=(ALL) NOPASSWD: /sbin/reboot
patrick ALL=(ALL) NOPASSWD: /usr/sbin/hddtemp

and it works fine (i have no uncommented %wheel section).

you did login/out since the change, yes?

Offline

#7 2010-03-04 22:24:33

skanky
Member
From: WAIS
Registered: 2009-10-23
Posts: 1,847

Re: [SOLVED] Sudoers Help

Yes, I did logout & back in wink (I'll forget to mention that when I first started looking into this I forgot to do that).

Anyway, tuurns out it is the order. The user is obviously overridden by the group they are in. It probably does say this in the manual, but even now a quick extra look and I've missed it.

Many thanks to everyone above. smile

Last edited by skanky (2010-03-04 22:25:09)


"...one cannot be angry when one looks at a penguin."  - John Ruskin
"Life in general is a bit shit, and so too is the internet. And that's all there is." - scepticisle

Offline

Board footer

Powered by FluxBB