11

I have a server where users are connecting using the RDP protocol, and accessing a Gnome desktop environment.

Even if they do not have permissions, I want to avoid any temptation/mistake/confusion given by the button "Shutdown". Just a "Log out" button provided by this extension

I could not find extensions that allows me to hide or disable the button.

https://askubuntu.com/a/93956/197910 as suggested below did not work to solve this.

Is there a way to achieve it?

K7AAY
  • 17,705
Manuel
  • 988

3 Answers3

12

You may use this gnome-shell-extension Remove PowerOff

Ubuntu 18.04.3 enter image description here

Ubuntu 19.10 enter image description here

2

You can use this extension to hide the shutdown button.

hide shutdown button.png


This article describes how to disable shutdown and reboot:

Certain Linux distros such as Ubuntu, Linux Mint, Mandriva just to mention but a few, make it possible to reboot/halt/shutdown the system as a normal user, by default. This is not ideal setting especially on servers, it must be something to worry about especially for a system administrator.

Here are a summary of steps in article:

  • Edit /etc/sudoers to disable shutdown.
  • Use chmod o-x /sbin/shutdown and chmod o-x /sbin/reboot to deny permissions.
  • For systemd based systems (probably most today) use: chmod o-x /bin/systemctl which /sbin/shutdown and the rest have symbolic links to.

I don't know how to change the GUI to remove the "Shutdown" button but you can tell the users not to press it and if they do nothing will happen.

0

Adding the following lines into a file
/etc/polkit-1/localauthority/50-local.d/restrict-login-powermgmt.pkla
will prevent shutdown from working. Other options will still work, and the server can still be shut down from the command line.

[Disable lightdm PowerMgmt]
Identity=unix-user:*
Action= org.freedesktop.login1.power-off;org.freedesktop.login1.power-off-multiple-sessions
ResultAny=no
ResultInactive=no
ResultActive=no

K7AAY
  • 17,705