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, 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