How do I restrict "su - root" access to a set of users but allow all users to su to each other?

Solution Verified - Updated -

Issue

  • Only certain team members should be able to "su" to root. All other users should be able to su to any other account apart from root.

  • Eg :-

    • user1 & user2 must be able to su to root.
    • All other users should not able to switch user to root but can su to each other (with passwords).

Environment

  • Red Hat Enterprise Linux 5, 6, 7 and 8
  • PAM (Pluggable authentication modules)

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