Question on screen lock with an auto-logged in box

We have RedHat 7.9 workstations running GNOME. We auto-login to the system via /etc/gdm/custom.conf and then we start our app (essentially it acts like a “kiosk”). /etc/dconf/db/local.d/ has our dconf file that has:
[org/gnome/desktop/lockdown]
disable-lock-screen=true

In the old days of RedHat 6.x, we could bring up a Unix terminal and then as a user (not the auto-logged in user), we could launch gnome-screensaver-command -l and lock the screen.

That does not work in RedHat 7.x Is there a different way to do it?

Oh wow, gnome-screensaver was removed from GNOME for GNOME 3.0 back in 2011. Welcome to the future! :slight_smile:

Here is your solution:

gdbus call --session --dest org.gnome.Shell.ScreenShield --object-path /org/gnome/ScreenSaver --method org.gnome.ScreenSaver.Lock

Of course I have not actually tested that on RHEL 7.9, but it works with GNOME 43 and will probably also work in 7.9.

P.S. RHEL 7 maintenance support ends next year, so strongly consider upgrading to RHEL 8 or RHEL 9. Then again, since you were previously on RHEL 6, you must be pretty comfortable with not getting OS updates…

loginctl lock-session

should work as well.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.