Set empty password for a specific user and user can login without password

Solution Verified - Updated -

Issue

  • Have a nullok entry in /etc/pam.d/system-auth and /etc/pam.d/password-auth file:
$ more /etc/pam.d/system-auth |grep nullok
auth [success=1 default=ignore] pam_succeed_if.so user <username> 
auth sufficient pam_unix.so try_first_pass nullok 
  • If an enabled account on the system is not password protected, then the users can login with no password. How do fix this issue?

Environment

  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • Red Hat Enterprise Linux 9
  • PAM

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