We have installed AlmaLinux 8.10 on our desktops. One user works on the machine physically, whereas a few others may have logged in remotely using XRDP.
Because there can thus be multiple users logged in to the system, we want to restrict normal users from clicking Restart or Power Off on the power button menu in the top right corner. Presently it seems free for all and any normal user seems to be able to shutdown/restart.
We want to restrict this ability. Clicking these options should popup a prompt for root password, or should error out if the user isn’t a sudo user. If this is not possible, then the power button should be totally removed for non-root users.
We’d like ditto restrictions from restarting or shutting down from the command line in a terminal. We’d like to restrict normal users from doing so.
How do we set this up? Kindly advise.