How can I limit SSH access based on time restrictions?

Updated -

To be able to limit SSH (Secure Shell) remote logins based on time restrictions, you need to setup Pluggable Authentication Module (PAM). The module that is needed to achieve our goal is the pam_time.so.

In order to setup time restrictions for SSH user logins, the following must be placed in /etc/pam.d/sshd:

/lib/security/pam_time.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.