Friday, January 13, 2012

How to lock the screen saver (or any feature) in gnome.

This one was a pretty big pain to find for some reason so I decided to put it here. If you use gconf-editor this is really easy. Just run gconf-editor with root privileges (sudo, or as root) and navigate to the setting you would like to change. For our example, we'll change the gnome-screensaver settings. This was tested in RHEL 5.6, 5.7, and 6.2.

If you don't have gconf-editor, you can install it with yum (yum install gconf-editor).

mybox $ sudo gconf-editor

Then expand apps->gnome-screensaver

Change the appropriate settings and then right click on them. You can select “Set as Mandatory” to lock this setting for all users.

If you have many systems you need to lock down you can use the command line tool called gconftool-2. Below is an example of the command line usage to change the screen saver settings to for screen lock on users after 15 minutes of inactivity.

mybox $ gconftool-2 --direct \

--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \

--type bool \

--set /apps/gnome-screensaver/idle_activation_enabled true


mybox $ gconftool-2 --direct \

--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \

--type bool \

--set /apps/gnome-screensaver/lock_enabled true


mybox $ gconftool-2 --direct \

--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \

--type string \

--set /apps/gnome-screensaver/mode blank-only


mybox $ gconftool-2 --direct \

--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \

--type int \

--set /apps/gnome-screensaver/idle_delay 15

No comments:

Post a Comment