Shutdown

From MineOS Wiki
Jump to navigation Jump to search

As a security measure, the capability to reboot and shutdown is provided exclusively for root. The recommended way to perform each act is listed top to bottom (only need to use one).

Shutting down

<syntaxhighlight lang="bash"> poweroff shutdown -h now halt </syntaxhighlight>

Rebooting

<syntaxhighlight lang="bash"> shutdown -r now reboot </syntaxhighlight>

Unprivileged Users

There are instances where you may want to have this capability extended to new, unprivileged users, in order to not have to provide root credentials, or 'sudo' power. The following commands will allow users of group games perform a reboot or a poweroff in addition to the root user.

This effectively says:

  1. Make 'halt' owned by group games
  2. Let only the owner (root) and the group games execute this command
  3. Let all requests (by either root or games) act as if executed by the owner (root)

Thus, when root or any games member executes reboot or poweroff, it is has the privileges of root and executes properly.

This is in contrast to the default configuration:

  • halt is executable by ALL users (777)
  • The 'halt' binary checks the effective UID for '0' (root).
    • If root, honor request.
    • If other, deny request and return 'must be superuser'