M
M
m0ps2013-10-21 14:22:01
Gnome
m0ps, 2013-10-21 14:22:01

How to set Ubuntu desktop lock policies with a script?

There is a fleet of PCs (quite large) on which you need to configure the desktop lock policy as follows:
1) lock the screen when idle for 10 minutes;
2) require a password when unlocking.
Is it possible to solve the problem with the help of a script, without resorting to clicking on the menus with the mouse?

PS OS: Ubuntu 12.04 (with Unity and classic gnome)

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nadz Goldman, 2013-10-22
@nadz

The question should be more specific.
Here is the answer.
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type bool \
--set /apps/gnome-screensaver/idle_activation_enabled true
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type bool \
--set /apps/gnome-screensaver/lock_enabled true
gconftool-2 --direct \
--config-source xml:readwrite:/etc/gconf/gconf.xml.mandatory \
--type string \
--set /apps/gnome-screensaver/mode blank-only
gconftool-2 --direct \
--config-source xml:readwrite: /etc/gconf/gconf.xml.mandatory \
--type int \
--set /apps/gnome-screensaver/idle_delay 10

M
m0ps, 2013-10-21
@m0ps

Ubuntu 12.04 with Unity uses gnome-screensaver. This is where you need to configure it.
In the box, it works and does what it needs, but for some it may be turned off. This is what needs to be sorted out now.

N
Nadz Goldman, 2013-10-22
@nadz

Puppet (for example, here ) will save you.
Well, or Chef.
Well, or similar =)
We scatter the configs on the machines and have happiness.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question