Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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

I found the solution to this in the below link

you may need to change the ftp url's to




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.