I did it adding the following line, but doesn't work (at least in my case):
username ALL=(ALL) NOPASSWD:/sbin/shutdown -h now
then making a launcher in the desktop with the following instruction:
sudo shutdown -h now
When I tried it, keeps asking me the password. What am I doing wrong?
PS: I'm using visudo
sudo /sbin/shutdown -h now(note the full path just like in/etc/sudoers). – Philipp Wendler Aug 13 '12 at 6:08username)? Lines starting with#are comments and are irrelevant. – Philipp Wendler Aug 13 '12 at 6:53sudoersfile does not have sections, it is just a list of lines. – Philipp Wendler Aug 13 '12 at 7:07