1

When I type

reboot

I get

reboot: Need to be root

P.S. I do not have sudo privileges and password

UAdapter
  • 17,587

3 Answers3

1

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).

  • And if you don't have permissions to make the changes on another account, reboot to recovery mode, select the 'remount' option, and then the 'root' option and do it then you will, but it's probably best to ask the machine admin do do it for you .... – ams Dec 02 '11 at 12:27
  • I can reboot using the GUI (unity?gnome?) – UAdapter Dec 02 '11 at 12:31
  • Yes, since GDM/LightDM is allowed to reboot the computer if nobody else is logged in. But it is not really you who shuts it down. – Martin Ueding Dec 02 '11 at 18:18
1

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.Stop

and to restart

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.ConsoleKit.Manager.Restart

For a list of possible actions run

dbus-send --system --print-reply --dest=org.freedesktop.ConsoleKit /org/freedesktop/ConsoleKit/Manager org.freedesktop.DBus.Introspectable.Introspect
arrange
  • 14,959
0

Try this command

systemctl reboot -i

To shutdown run this

systemctl poweroff -i

to hibernate, suspend, hybrid run

systemctl hibernate -i
systemctl suspend -i
systemctl hybrid-sleep -i
konmal88
  • 333