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 of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.