Skip to content
LogoTechnipages
LogoTechnipages
  • Topics
        • Android
        • Browsers
        • Gaming
        • Hardware
        • Internet
        • iPhone
        • Linux
        • macOS
        • Office
        • Reviews
        • Software
        • Windows
        • Definitions
        • All Recent Posts
  • Product Reviews
  • About

Linux: How to Configure the Default Password Aging Settings for New Accounts

Mel HawthorneNovember 27, 2020 Comments (0)

If you’re managing a Linux system, one of the tasks you may have to do is manage the settings passwords for user accounts. As part of this process, you will likely need to manage the settings for both existing and new accounts.

Managing the password settings for existing accounts is done through the “passwd” command, although there are other alternatives. You can set default settings for accounts that will be created in the future, however, saving you from manually changing defaults for each new account.

The settings are configured in the config file “/etc/login.defs”. As the file is located in the “/etc” directory, it will require root permissions to edit. To avoid any issues where you make changes then can’t save them because you don’t have permissions, make sure that you launch your preferred text editor with sudo.

The section you want is near the middle of the file and is titled “Password aging controls”. In it are three settings, “PASS_MAX_DAYS”, “PASS_MIN_DAYS”, and “PASS_WARN_AGE”. Respectively these are used to set how many days a password can be valid for before needing to be reset, how soon after one password change another can be made, and how many days warning a user gets before their password is expired.

The default values for password aging controls can be found and configured in the file “/etc/login.defs”.

“PASS_MAX_DAYS” defaults to 99999 which is used to indicate that passwords should not automatically expire. “PASS_MIN_DAYS” defaults to 0 which means that users can change their password as often as they like.

Tip: A minimum limit on password age is normally combined with a password history mechanism in order to prevent users from changing their password and then immediately changing it back to what it used to be.

“PASS_WARN_AGE” defaults to seven days. This value is only used if a user’s password is actually configured to expire.

How to configure the default password aging settings for new accounts

If you want to configure these values so that passwords are automatically expired every 90 days, a minimum age of one day is applied, and users are warned 14 days before they expire you should set the values “90”, “1”, and “14” respectively. Once you’ve made the changes you want, save the file. Any new accounts that are created after you update the file will have the settings you configured applied to it by default.

Values “90”, “1”, and “14” respectively, configure passwords to automatically expire every 90 days, be changed at most once per day, and provide users warnings that their password needs to be changed fourteen days before it expires.

Note: Unless mandated by policies, you should avoid configuring passwords to automatically expire over time. The NCSC, NIST, and the wider cybersecurity community now recommend that passwords are only expired when there is reasonable suspicion that they have been compromised. This is due to research that has shown that regular mandatory password resets actively push users towards choosing weaker and more formulaic passwords that are easier to guess. When users are not forced to regularly make and remember a new password, they’re better at creating longer, more complex, and generally stronger passwords.

Categories: Software

Author Mel Hawthorne

You Might Also Like

  • Fix Microsoft Teams Keeps Restarting

    Madalina DinitaSoftware
  • fix caa70007 microsoft teams

    Troubleshooting Microsoft Teams Error caa70007

    Madalina DinitaSoftware
  • MS Teams Header

    Microsoft Teams: How to Disable Animations

    Madalina DinitaSoftware
  • microsoft teams Enable Logging For Meeting Diagnostics

    Teams: Enable Logging for Meeting Diagnostics

    Madalina DinitaSoftware

Leave a Reply

Your email address will not be published. Required fields are marked *

  • fix error 0x9cfc7550

    How to Fix Error 0x9cfc7550 (We Couldn’t Create a New Partition) in Windows 

  • fix error code 0x3000008 1

    How to Fix Error Code 0x3000008 for Remote Desktop Connection

  • fix error code 0x80190001 1

    How to Quickly Fix Error 0x80190001 for Microsoft or Outlook Account Login 

  • fix filecoauth.exe application error

    Fix FileCoAuth.exe Application Error 

  • fix error code 0x80010002 in windows update

    How to Fix 0x80010002 Error in Windows Update 

profile pic

The Experts Behind Technipages

My name is Mitch Bartlett. I've been working in technology for over 20 years in a wide range of tech jobs from Tech Support to Software Testing. I started this site as a technical guide for myself and it has grown into what I hope is a useful reference for all.

Learn More

technipages logo white
linkedin icon

Technipages is part of Guiding Tech Media, a leading digital media publisher focused on helping people figure out technology. Learn more about our mission and team here.

© 2025 Guiding Tech Media All Rights Reserved

  • About Us
  • Contact
  • Terms of Use
  • Privacy Policy

© 2025 Guiding Tech Media All Rights Reserved

Information from your device can be used to personalize your ad experience.
Do not sell my personal information.

Last Updated on November 27, 2020 by Mitch Bartlett