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"

-- 
 
uname -rsvp
Linux 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
(yes, this is the output from uname for this PC when I posted)
 
Boilerplate:  All unexpected mail to my mailbox is automatically deleted.
I will only get to see the messages that are posted to the mailing list.
 

-- 
_______________________________________________
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