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?

  • 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 2 at 22:20

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.

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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