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

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


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