When I type
rebootI get
reboot: Need to be rootP.S. I do not have sudo privileges and password
3 Answers
On Debian, you have to be a member of the powerdev group in order to shut the computer down as a regular user. I am not sure how this works in Ubuntu.
What you can do either way is to use the setuid bit in order to allow anyone to reboot the computer. Think about it, before you do this though. Maybe you can only set the setuid for the group of reboot and change the group of reboot to your own user group (or create a new power group by hand).
We don't know what Ubuntu you're using but to power off the computer try
dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Stopand to restart
dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.RestartFor a list of possible actions run
dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.DBus.Introspectable.Introspect Try this command
systemctl reboot -iTo shutdown run this
systemctl poweroff -ito hibernate, suspend, hybrid run
systemctl hibernate -i
systemctl suspend -i
systemctl hybrid-sleep -i