How do I configure my system so that some users do not have console login but other users can still 'su' to those users?

Updated -

In order to configure the system to deny console logins for certain users but still allow other users to su to those users, we will be utilizing the Pluggable Authentication Modules' (PAM) module.

The first thing to do is to modify the /etc/pam.d/login to look like the example below:

auth       required     ...

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