Sponsored Link
Method 1
Edit the file /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy using your favorite text editor. You will need root permissions.
gksudo gedit /usr/share/polkit-1/actions/org.freedesktop.consolekit.policy
Change the section relating to shutdown when others are logged in from
and the section relating to rebooting when others are logged in from
And that will allow you shutdown and reboot the PC when multiple users are logged in.
Method 2
If you have dbus-send installed, you can shutdown via dbus without the need to escalate to root privileges.
Shutdown:
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Shutdown
Reboot:
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Reboot
Suspend:
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:1
Hibernate:
dbus-send --system --print-reply --dest=org.freedesktop.Hal \
/org/freedesktop/Hal/devices/computer \
org.freedesktop.Hal.Device.SystemPowerManagement.Hibernate
Via Askubuntu
Put this line in the /etc/sudoers and all people of the group users didnt needs any password for the reboot command.
[code]%users ALL = NOPASSWD: /sbin/reboot[/code]
you can schedule your shutdowns. I love it. I download all night and shutdown the computer at 7 am.
sudo shutdown -h 07:00
requires a password but only when you type the command.
Interesting. Was expecting to see a change to sudo file like Dani gave. Didn’t know about these other alternative methods.