"IdleAction=lock" in /etc/systemd/logind.conf not working

Solution Verified - Updated -

Issue

  • We want to preset timeout to lock virtual console in the text-mode.
  • Although I set /etc/systemd/logind.conf as below, it does nothing after 2 minutes.
[Login]
IdleAction=lock
IdleActionSec=2min

Environment

  • Red Hat Enterprise Linux 7/8
  • systemd

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content