Excellent hint from
DutchDaemon.
Let me add a little tip and a small correction: Some people like myself are annoyed by having to have daemons like
polkit (and other
systemd or Freedesktop friends) running basically for little more than reboot/shutdown without a password.
Code:
you ALL = NOPASSWD: /sbin/shutdown,/sbin/poweroff
in
sudoers does the trick (where
you is obviously your username). simply calling, for instance,
sudo shutdown -r now
in your window manager's menu will reboot your system without
polkit (which basically does something like
sudo but with sh*loads of crap and XML and a daemon). Great for Openbox and other minimalist window managers.
Note the order. The first item is the user (or group) for whom the given entry shall be valid (that's the correction. root evidently doesn't need to
sudo
and if he likes to, say, to downgrade, he won't need a password anyway). The next item (here "ALL" is he host; usually you'll just leave it at "ALL"). The next item would be the "target user" as whom to run, something like "(www)" which isn't needed if that user is root and the last item is one or more (comma separated) commands with an optional tag: like NOPASSWD in front.
Finally, a reminder: you must use
visudo
to edit
sudoers!