Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I automatically lock the screen when idle in CentOS?

I would like it so that a user has to re-enter their password once the machine has been idle for a period of time.

If there is no option to do this in CentOs, what other solutions would allow me to achieve this?

share|improve this question

migrated from stackoverflow.com Jul 11 '12 at 23:27

This question came from our site for professional and enthusiast programmers.

What is the desktop environment you are using???? gnome???? –  user637152 Jul 11 '12 at 8:53
yes,,it's GNOME...=) –  trguapo Jul 11 '12 at 9:10
You can use xscreensaver. –  user315052 Jul 11 '12 at 9:20

3 Answers 3

I found the solution to this in the below link


you may need to change the ftp url's to

wget ftp://ftp.sunet.se/pub/Linux/distributions/centos/5/os/x86_64/CentOS/libXp-1.0.0-8.1.el5.x86_64.rpm


wget ftp://ftp.sunet.se/pub/Linux/distributions/centos/5/os/x86_64/CentOS/openmotif-2.3.1-7.2.el5.x86_64.rpm

the third URL given works fine. Just follow the instructions on the blog and you will be fine.

share|improve this answer

Go to System -> Preferences -> Screensaver Then change the computer idle time and enable Lock screen when screen saver is idle settings.

share|improve this answer
it doesn't work for my Cent0s 5.8,,and i want to emphasize that i'm logging in as root,,I want to login as root! =) –  trguapo Jul 11 '12 at 9:36

try using the following commands Set the idle delay by replacing 1 with the delay you want. The time is in minutes.

gconftool-2 --type int --set /desktop/gnome/session/idle_delay 1

set the disable_lock_screen false to ask for password after idle time out or disable_lock_screen true for no password after idle timeout.

gconftool-2 --type bool --set /desktop/gnome/lockdown/disable_lock_screen false

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.