How do i set password expiry for all users?

6,875

Edit /etc/login.defs using a text editor:

vi /etc/login.defs

Edit these 3 parameters to what you want (example from the file and the defaults given):

#
# Password aging controls:
#
#   PASS_MAX_DAYS   Maximum number of days a password may be used.
#   PASS_MIN_DAYS   Minimum number of days allowed between password changes.
#   PASS_WARN_AGE   Number of days warning given before a password expires.
#
PASS_MAX_DAYS   99999
PASS_MIN_DAYS   0
PASS_WARN_AGE   7
Share:
6,875

Related videos on Youtube

Gorum
Author by

Gorum

Updated on September 18, 2022

Comments

  • Gorum
    Gorum over 1 year

    I need to set the password expiry time for ALL users at once with the terminal, or at least by group. Is there any way to do this? Without using suspicious or sketchy software/sites? Thankyou!

  • Akshay
    Akshay about 7 years
    Do we need to restart any service after that? Or it is hot deployed?
  • Rinzwind
    Rinzwind about 7 years
    It will be active as soon as it is saved.