1

Since I've been manually updating Ubuntu MATE 16.04 using apt update, upgrade I also manually reboot using this command sudo init 6

Once I forgot sudo and it worked; further testing proved that reboot and shutdown also functioned without using sudo.

I tested this using vanilla Ubuntu 14.04 and found that sudo was mandatory.

2
  • Why don't you use reboot and shutdown -h now (which are easier to remember, in my opinion)? Also, I can second your observation that sudo is mandatory with both reboot, shutdown -h now and init 6 on a near-vanilla 14.04. It's not possible by default to use the aforementioned commands without sudo. – grooveplex Jun 26 '16 at 18:13
  • stated in my op "further testing proved that reboot and shutdown also functioned without using sudo." – pfeiffep Jun 27 '16 at 1:41
3

It is a design feature that since 16.04 you do no longer need root privileges to shut down or reboot the system through any method. Instead the systemd and its systemctl tool accept those commands from regular users.

All related commands like shutdown, reboot, halt, poweroff are symbolic links ("symlinks") to /bin/systemctl and init is a symlink to /lib/systemd/systemd now by the way. You can verify this using the command file $(which COMMAND), replacing "COMMAND" with the one you want to check.

5
  • I question not your answer but the wisdom of enabling power off, shutdown, etc without sudo. – pfeiffep Jun 27 '16 at 1:57
  • 1
    I don't really understand this decision by the developers either and I could also not find any resources about that on the web. Sorry. – Byte Commander Jun 27 '16 at 6:41
  • Related question: halt, poweroff, shutdown, reboot don't require root? – Mark Stosberg Jun 27 '16 at 16:02
  • @MarkStosberg But that one is about Arch Linux... – Byte Commander Jun 27 '16 at 16:20
  • 2
    @ByteCommander the question is about the functionality of systemd which is used by both Ubuntu 16.04 and and Arch Linux to handle power management functions. – Mark Stosberg Jun 27 '16 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.