How to lock local users(using SSH keys for login) based on inactivity in Red Hat Enterprise Linux 6/7

Solution Verified - Updated -

Issue

  • How do I lock user accounts based on inactivity which use SSH keys (and not password) for login in RHEL 6/7?
  • I tried configuring pam_lastlog.so module to local local users based on inactivity but it doesn't work for users which use SSH keys for login.

Environment

  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • pam_lastlog.so

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