Skip to content
ENExplore Calculators

Password Expiry Calculator

Calculate password expiration date from chage aging policy settings like PASS_MAX_DAYS.

About Password Expiry Calculator

Linux password aging (configured system-wide in /etc/login.defs as PASS_MAX_DAYS/PASS_WARN_DAYS, or per-user via `chage`) forces periodic password rotation by tracking the last change date in /etc/shadow. The number of days remaining is simply the maximum lifetime minus how many days have already elapsed since the last change; once that goes to zero or negative the account is treated as expired, and PAM will prompt (or block, depending on PASS_INACTIVE) the user to set a new password at their next login attempt.

Formula

Days remaining

days_remaining = PASS_MAX_DAYS − (today − last_change_date)

M
PASS_MAX_DAYS
T
today
L
last change date

Worked example

With the default values below, Password Expiry Calculator returns Days Remaining Until Expiry of 28. Change any input above and every figure here is recalculated in your browser.

Inputs used

Last Password Change Date
2026-06-01
PASS_MAX_DAYSminimum 1
90
PASS_WARN_DAYSminimum 0
7
Evaluation Date (today)
2026-08-02

Results

Days Remaining Until Expiry
28
Status
Password is valid for 28 more day(s) before expiry.
Expiry Date
2026-08-30
Days Since Last Change
62
Already Expired?
false
In Warning Window?
false

Step by step

  1. 1Values used
  2. 2Days remaining
  3. 3Days Remaining Until Expiry= 28
  4. 4Status= Password is valid for 28 more day(s) before expiry.
  5. 5Expiry Date= 2026-08-30
  6. 6Days Since Last Change= 62
  7. 7Already Expired?= No
  8. 8In Warning Window?= No

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How do I check a user's password aging status on Linux?

`chage -l <username>` (as root) shows last change date, expiry date, and warning period. Non-root users can run `chage -l $(whoami)` to see their own aging info.

What's the difference between PASS_MAX_DAYS and PASS_INACTIVE?

PASS_MAX_DAYS is when the password itself expires and must be changed. PASS_INACTIVE is a grace period (in days) after expiry during which the user can still log in only to change the password; once PASS_INACTIVE also elapses, the account is locked entirely until an administrator intervenes.

Does changing PASS_MAX_DAYS in /etc/login.defs affect existing users?

No — /etc/login.defs values are only applied to newly created accounts. To change aging policy for an existing user, use `chage -M <days> <username>` directly, which updates the relevant field in /etc/shadow for that account.

Password Expiry Calculator (Security) | Calcrivo