Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Linux/Password Expiry

April 8, 2018

Password Expiry

If you’re asked to change the password expiry or password inactivity for a Linux user, the following command will fix it. It’s ideal in situations where you don’t want the password to expire or you don’t want a user to go inactive. It’s also useful if you want a user to be running automated scripts. Here’s the chage command and its available options.

# chage -m 0 -M 99999 -I -1 -E -1 johndoe

# chage -m 0 -M 99999 -I -1 -E -1 johndoe

-m 0 will set the minimum number of days between password change to 0
-M 99999 will set the maximum number of days between password change to 99999
-I -1 (number minus one) will set the “Password inactive” to never
-E -1 (number minus one) will set “Account expires” to never.

To validate a user options, run the following:

# chage --list johndoe
Last password change                                    : Apr 4, 2018
Password expires                                        : never
Password inactive                                       : never
Account expires                                         : never
Minimum number of days between password change          : 0
Maximum number of days between password change          : 99999
Number of days of warning before password expires       : 7

# chage --list johndoe Last password change : Apr 4, 2018 Password expires : never Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 99999 Number of days of warning before password expires : 7

Filed Under: Linux Tagged With: chage

Have content delivered to your mail. Subscribe below.

About Me

I'm Ulysses, Cloud Engineer at Cardinal Health based in Columbus. This blog is about Linux and Cloud technology. When off the grid, I enjoy riding my electric skateboard. I've surfed, snowboarded and played the saxophone in the past. I hope you find this website helpful. It's powered by WordPress and hosted on AWS LightSail.

  • Cloud
  • Linux
  • Git

Copyright © 2012–2021