Logout locked Gnome Sessions after Specified Period

Latest response

Is there a way to force logout of a user after their gnome session has been locked for a specified period of time?

This is how it was done in RHEL 6 with gconf:

However, RHEL 7 has dconf and these settings no longer apply. I have found how to logout user sessions when the computer has been idle for a specified period of time using the /org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-timeout and
/org/gnome/settings-daemon/plugins/power/sleep-inactive-ac-type keys. However, if the computer is processing data, it will not register as idle to the power plugin and therefore will not log out sessions.

Any guidance is appreciated.


Hi Jason.

Do you want this function, or perhaps this function at paragraph 14.8?


p.s. I can provide more info perhaps tomorrow or so if needed.

Thank you for the response RJ, Unfortunately, neither of those are what I'm looking for. The first item you linked (STIG) locks an unattended screen after a period of inactivity and has already been implemented. Your second recommendation logs off all users when the machine has been idle for a specified period of time. If another user logs into the computer, it will not log out the unused gnome session because the system is not idle.

What I'm looking for is a way to terminate any gnome sessions that have been locked for a specified period of time even if the system is in use by someone else. Example of what I'm looking for if specified period is 2 hours: Bill locks his Gnome session at 11am. Sally logs in at noon and begins to use the system. Sally is still using the system at 1pm, so Bill's session gets logged off at 1pm because it has been locked and unused for 2 hours. Sally keeps working and is unaware that Bill's session has been terminated.

Hi Jason, sorry those suggestions didn't fit for you. I noticed your initial description of "force logout of a user after their gnome session has been locked for a specified period of time " and tried the first two suggestions.

Your additional description helps I'll see if I can find something later. By the way, the help within this discussion forum is generally from volunteers such as myself (I am not an employee of Red Hat). Red Hatters do occasionally chime in. You can put in a case if you need something faster.

Kind Regards,


I haven't had time to evaluate it fully, but will anything within chapter 14 of the documentation at this link fit for what you describe? That area of the documentation has some of what I linked to in a previous post, but I'm not sure if the surrounding configs may or may not be useful for the specific scenario you described. I'll have more time to evaluate later today



I re-read the document I mentioned (the 2nd link). It says:

14.3.7. Configuring Automatic Logout
User sessions that have been idle for a specific period of time can be ended automatically. <more below>

After that, it mentions this:

You can set different behavior based on whether the machine is running from a battery or from mains power by setting the corresponding GSettings key, then locking it.

From what I'm reading, it is supposed to log off each user based on their level of inactivity.

  • I implemented what I saw at that second link
  • I compared that to what I also saw at https://help.gnome.org/admin/system-admin-guide/stable/logout-automatic.html.en
  • I set it for 300 seconds unlike the example and rebooted the system. I logged in as one user named "elvis" and then switched users to "sheldon" I ran a command to watch this of watch 'w;date' which will tell me who is logged in and their idle time. **The user "elvis" was never logged out (even much later as I'm typing this). Neither was the user sheldon despite receiving the below warning.
  • Sadly, it didn't log either of the users out when the idle time went past 300 seconds. I am using the most recent patched edition of Red Hat Linux 7.7 with "server-with-gui" using gnome.
  • Unfortunately, this mimicked the information I found in this Bugzilla https://bugzilla.redhat.com/show_bug.cgi?id=1063093. This is odd because that Bugzilla is quite old. That Bugzilla is for fedora, and they are using lightdm (I am using standard Red Hat and not lightdm).
  • I also found this centos bug https://bugs.centos.org/view.php?id=9190.

The 2nd user I had logged in received a pop-up warning saying:

Automatic Logout 
You will soon log out because of inactivity

However, this warning was never followed by an actual logoff. Personally, I'm going to submit a case. I recommend you submit a case with Red Hat on this as well. Perhaps there is another setting they can find, maybe that I missed. In any case, I'm going to double-check in a list of other settings we have tomorrow.


Thanks for your help on this RJ, I really appreciate the feedback and the validation that what I'm seeing doesn't mean I'm crazy. I am submitting a case with Red Hat now. I also am using standard Red Hat 7.7 with latest patches - both Workstation and Server with GUI.

Jason and RJ, Did you ever get a resolution for this? I think I'm running into the same issue on Red Hat 7.9.

Hi Mike,

I kinda suspect the reason I haven't seen this is because I don't enable that feature and our local company approved this and documented it. I'm verifying this and will get back here in a day or two.

I am pretty sure the way we justified it was it was enough there was a mandatory time for a screen lock to engage, and we've appropriately put in the screen locks for whatever desktop environment is approved, and we didn't want to kill people's work just because they went away for a break from their computer. The screen lock engages and it was excessive for the system to force-log-off the user.

Anyway, I'll get back in a day or two on this.


With some more digging I found this issue. https://access.redhat.com/solutions/2210911 I confirmed with my tech that this was working as expected in RHEL 7 on a VM and it looks like I will need to update to the August patches for RHEL 8. Sorry for the confusion on this - it is working in RHEL 7 at least.

Thanks Mike!! appreciate the update!