Search This Blog

Tuesday, 18 November 2025

OCI - Oralce linux - warning your password will expire in 6 days - use command "chage"

 

If OS user gets the warning message for password expiry in OCI Oracle linux, then change the password expiry, following are the 2 methods

System-wide settings (via /etc/login.defs) 
PASS_MAX_DAYS: Sets the number of days a password is valid. After this period, the user is forced to change their password.
  • PASS_MIN_DAYS: Sets the minimum number of days that must pass before a user can change their password, preventing them from changing it back immediately.
  • PASS_WARN_AGE: Specifies the number of days before a password expires that the user receives a warning.
  • LOGIN_DEFS_FILE: The path to the login.defs file, which contains default values for password aging and other user-related settings. 
  • Individual user settings (via chage) 
  • chage -M <days> <username>: Sets the maximum number of days a password is valid for a specific user.
  • chage -m <days> <username>: Sets the minimum number of days between password changes for a specific user.
  • chage -W <days> <username>: Sets the number of days before expiration that the user is warned.
  • chage -E <YYYY-MM-DD> <username>: Sets an absolute expiration date for the user's password.
  • chage -l <username>: Displays the current password aging information for a specific user.

  • Example: 

[opc@testserver~]$ sudo change -M 365 testuser

sudo: change: command not found

make sure that command is "chage" and not chaNge!!

[opc@testserver ~]$ sudo chage -M 365 testuser

[opc@testserver ~]$


[opc@testserver ~]$ sudo chage -l testuser

Last password change                                    : Sep 18, 2025

Password expires                                        : Sep 18, 2026

Password inactive                                       : never

Account expires                                         : never

Minimum number of days between passwor

No comments:

OCI - Oralce linux - warning your password will expire in 6 days - use command "chage"

  If OS user gets the warning message for password expiry in OCI Oracle linux, then change the password expiry, following are the 2 methods ...