On Mon, 08 Sep 2025 10:45:17 +0930
Tim <ignored_mail...@yahoo.com.au> wrote:

> On Sun, 2025-09-07 at 22:19 +0200, Franta Hanzlík via users wrote:
> > We have a x86_64 Linux Mate machine, located at a remote place, and 
> > several users occasionally log in via x2go, and start MATE sessions. 
> > I need to prevent the user from being able to shut down this remote 
> > machine - the optimal solution would probably be to remove or disable 
> > the "System" -> "Shut Down" button in the MATE menu.
> > But how to do that?  
> 
> I'd look more into preventing users shutting down than changing menus. 
> Removing an option from a menu wouldn't actually prevent them shutting
> down, it'd just remove the "click on this thing to do it" way of doing
> it.  If you really want to prevent them shutting things down you need
> to restrict access to the commands involved to only the few users
> allowed to do that.  Probably restrict reboot, and some others, as
> well.  And there's CTRL ALT DEL to contend with, you could change the
> hotkey combo to shutdown to something else and set CTRL ALT DEL as the
> hotkeys for logout.
> 
> Look into systemctl mask sleep.target, and suspend.target, and
> hibernate.target.  Changing execute permissions for poweroff, shutdown,
> and systemctl commands for all users.  And there's polkit rules for
> graphical menu ways of shutting down.
> 
> Of course if you're allowing them admin-level access, then you have
> little hope of preventing it.  Most restrictions work on ordinary
> users, so that only an admin can do these things.
> 
> You could change the desktop background to have a large sign saying
> "log out when finished, do not shutdown"
> -- 
There are three of us connecting to that machine, we are all friends, 
no one has any intentions of harming it or turning it off on purpose. 
But the "Shut down" button is right next to "Log Out", and it has 
happened to us several times that we managed to turn off the machine 
 - either by clicking next to it, or in distraction and haste someone 
thought they were finishing and turned off their PC...

The fact that the machine can be turned off from the command line or 
in some other more complicated way does not matter - my colleagues are 
afraid of command lines "like hell" and they will definitely not look 
for any other ways to turn it off on purpose.
-- 
Thanks, Franta Hanzlik
-- 
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org
Fedora Code of Conduct: 
https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: 
https://lists.fedoraproject.org/archives/list/users@lists.fedoraproject.org
Do not reply to spam, report it: 
https://pagure.io/fedora-infrastructure/new_issue

Reply via email to