[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Prevent shutdown with systemctl



On 04/01/16 10:55 AM, Floris wrote:
Dear list,

Often there are multiple users working on my multiseat [1] system, some of them are kids and they are not paying attention if someone else is logged in. They can shutdown the computer even if someone else is logged in and have an active session.

Is it possible that only root can shutdown/ reboot the computer if multiple users are logged in and when there is only one user that user is able to shutdown the computer?

Thanks,

Floris

[1] https://en.wikipedia.org/wiki/Multiseat_configuration

/sbin/reboot is a link that allows anyone to execute it. It points to /bin/systemctl that also allows anyone to execute it. The first part of your problem can be solved simply with fixing the permissions for reboot, shutdown & poweroff.

The second part would be to track the users on the system (users | wc) and change the permissions as it changes between 1 and more than 1.

This is a bit of a brute force technique but it should work.


Reply to: