How do I disable the GNOME desktop screen lock?

Kashyap picture Kashyap · Feb 2, 2015 · Viewed 31.1k times · Source

How do I stop my GNOME desktop from locking the screen after a few minutes of idle time?

I already tried the official manual at Red Hat and tried to use gconf-editor and gconftool-2 to set /apps/panel/global/disable_log_out and /apps/panel/global/disable_lock_screen. No luck.

Answer

Mark Edington picture Mark Edington · Jun 4, 2017

On newer distributions of Linux, like Red Hat and CentOS 7, which run GNOME 3.x you'll want to disable this via the gsettings utility rather than gconftool-2. The default is 5 minutes before the system is considered idle. Setting the value to 0 disables this.

gsettings set org.gnome.desktop.session idle-delay 0

This setting can also be made in the GUI dconf-editor from a logged in session of the user in question.

From the standard System ToolsSettings application, there is also a "Blank Screen" option in the power settings which may provide the same behavior as the gsettings command given previously. In my testing, setting the "Screen Lock" to "Off" in the privacy settings DID NOT disable the screen blanking after 5 minutes.

On a final note, you cannot run that gsettings command from a remote SSH session without getting errors. See the last reference link below.

It was quite a research effort to get this disabled on my virtual machine!

References: