Set a password policy in Red Hat Enterprise Linux

Solution Verified - Updated -


  • To set a password policy, the requirements are as follows:
    • Requirement 1. password warntime=7(days before a forced password change that a warning will be given to the user informing them of the impending password change)
    • Requirement 2. maxage=13(maximum number of weeks a password is valid)
    • Requirement 3. minlen=8(minimum length of a password)
    • Requirement 4. minother=1(the minimum number of non-alphabetic characters in a password)
    • Requirement 5. minalpha=1(the minimum number of alphabetic characters in a password)
    • Requirement 6. Keep history of passwords used (the number of previous passwords which cannot be reused)
    • Requirement 7. Is it possible to use /etc/login.defs file for setting up the password related parameters
    • Requirement 8. How to configure pam_tally2 to lock user account after certain number of failed login attempts?
    • Requirement 9. How to set password should expiry after 90 days for individual user?
    • Requirement 10. How to change a user's password's maximum age such that the user does not have to reset the password when logging in the next time?


  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7

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