How do I restrict root user to use password authentication while switching to normal user?

Solution Verified - Updated -

Issue

  • root user should not be able switch to users using su - <username> without authentication.

  • root user should be authenticated while switching to user using su - <username> for specific users, while allowing password less authentication for specific users.

  • How do I restrict root user to use password authentication while switching to normal user and allow root user to use passworless authentication while switching between users for certain users only ?

Environment

  • Red Hat Enterprise Linux 6

  • Red Hat Enterprise Linux 7

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.