Henk van Lingen
2007-Sep-19 13:20 UTC
[CentOS] Disabling shutdown and suspend for normal users
Hi, [CentOS 5] What is the best way to remove the shutdown and suspend options from menu's for normal users? After googling around, I added "SystemMenu=false" to the greeter section in /etc/gdm/custom.conf. After that the GDM login screen still shows the options, but 'restart' indeed doesn't work anymore. However, the gnome menu's when logged in, still have the 'suspend' options, which still leads to a hanging (unwakeble) machine. BTW: I prefer editing config files instead of stupid gui's, as I have to change a lot of machines :-) Regards, -- Henk van Lingen, Systems Administrator & DBA (o- -+ Dept. of Computer Science, Utrecht University. /\ | phone: +31-30-2534107 v_/_ http://henk.vanlingen.net/ http://www.tuxtown.net/netiquette/
Bernhard Gschaider
2007-Sep-19 13:49 UTC
[CentOS] Disabling shutdown and suspend for normal users
>>>>> On Wed, 19 Sep 2007 15:20:37 +0200 >>>>> "HvL" == Henk van Lingen <henkvl at cs.uu.nl> wrote:HvL> Hi, HvL> [CentOS 5] HvL> What is the best way to remove the shutdown and suspend HvL> options from menu's for normal users? HvL> After googling around, I added "SystemMenu=false" to the HvL> greeter section in /etc/gdm/custom.conf. After that the GDM HvL> login screen still shows the options, but 'restart' indeed HvL> doesn't work anymore. However, the gnome menu's when logged HvL> in, still have the 'suspend' options, which still leads to a HvL> hanging (unwakeble) machine. Just set HaltCommand to nothing: HaltCommand Same for Reboot and Suspend (Havn't tried suspend yet) but my machines allow Reboot and Halt neither from the user menus nor the Login-Screen I think in the [daemon]-section of the config-file HvL> BTW: I prefer editing config files instead of stupid gui's, HvL> as I have to change a lot of machines :-) Of course
Erik Laxdal
2007-Sep-19 16:31 UTC
[CentOS] Disabling shutdown and suspend for normal users
Henk van Lingen wrote:> Hi, > > [CentOS 5] > > What is the best way to remove the shutdown and suspend options > from menu's for normal users? > > After googling around, I added "SystemMenu=false" to the greeter > section in /etc/gdm/custom.conf. After that the GDM login screen > still shows the options, but 'restart' indeed doesn't work anymore. > However, the gnome menu's when logged in, still have the 'suspend' > options, which still leads to a hanging (unwakeble) machine. > > BTW: I prefer editing config files instead of stupid gui's, as I have to > change a lot of machines :-)To remove the reboot/shutdown options from the login screen (after setting SystemMenu=False) two small modifications are needed to: /usr/share/gdm/themes/CentOSCubes/CentOSCubes.xml The two modifications are: 1. Change line 102 from: <show modes="console"/> to: <show type="reboot" modes="console"/> 2. Change line 118 from: <show modes="console"/> to: <show type="halt" modes="console"/> The lines above both of these should have an item tag refering to the appropriate reboot/halt button. Then restart the gdm. The shutdown and reboot buttons should no longer appear. I use the following command: gconftool-2 --config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory -s -t bool /apps/gnome-power-manager/can_suspend false to remove the suspend option from the gnome system menu. Also, deleting the symbolic links for halt, poweroff, and reboot in /usr/bin appears to remove the respective options from the menu as well as from the command line. Erik