-3

I need to create a user and deny them permission to turn off the machine.

DO SOMEONE KNOW HOW TO CHANGE THE PERMISSIONS OF A NORMAL USER TO NOT ALLOW ME TO TURN OFF?

Zoredache
  • 128,755
  • 40
  • 271
  • 413
Mr.John
  • 7
  • 5
  • What software is installed? Do you have a GUI or something? I doubt a unprivileged account could shutdown a minimal cli-only system. How are they shutting down the system? – Zoredache Oct 02 '18 at 22:20

1 Answers1

4

Use of shutdown requires a privileged account.

From freebsd.org's documentation:

One must be root or a member of operator in order to run shutdown(8).

If the user has sudo rights, you can forbid access to shutdown, reboot, poweroff and halt by modifying /etc/sudoers something like this:

username ALL=(ALL:ALL) ALL, !SHUTDOWN

or

%groupname ALL=(ALL:ALL) ALL, !SHUTDOWN to disallow a group.

sippybear
  • 2,997
  • 1
  • 12
  • 12