Adding group permissions with sudoers with NOPASSWD still prompting for password

1

Fedora 20, clean install. I added the following lines to my sudoers file with visudo:

%power ALL=NOPASSWD: /sbin/shutdown

I then created group "power" and added my account to this group. Rebooted, confirmed that I was in the group with the "groups" command.

However, when I type "sudo shutdown" I am still prompted for a password.


Update:

I previously had my permissions group %power located in the sudoers file below root:

root ALL=(ALL) ALL

but above %wheel:

%wheel ALL=(ALL) ALL

It works now if I move it to below %wheel. Why is this?

Zhro

Posted 2014-09-28T03:07:01.903

Reputation: 471

Answers

2

sudo processes the lines in order.

The ALL in the %wheel line applies to sudo /sbin/shutdown, and isn't tagged with NOPASSWD. Any user who is in both the wheel and power group would have to enter their password when running sudo /sbin/shutdown; users just in the power group would not.

Daniel Holz

Posted 2014-09-28T03:07:01.903

Reputation: 31