Friday, May 9, 2014

Chage Command with example to manage Linux password expiration


chage - change user password expiry information 


chage changes the number of days between password changes and the date of the last password change. This information is used by the system to determine when a user must change her password. The chage command is restricted to the root user, except for the -l option, which may be used by an unprivileged user to determine when her password or account is due to expire.

  • To see list of account policy of user:

$ change -l username


  • To change maximum number of days, to which a password is valid:
$ change -M value username


  • To change minimum number of days between password changes:
$ change -m value username


  • To set the number of days of warning before a password change is required:
$ change -W value username

  •  To set the number of days of inactivity after a password has expired before the account is locked:

$ change -I value username


  •  To set a date on which the user's account will no longer be accessible:
$ change -E mm/dd/yyyy username


  • To change, when last password changed.

$ change -d mm/dd/yyyy username


Configuration  file example:



 By Linux-Care

Related Posts:

  • df df command examples Displays the file system disk space usage. By default df -k displays output in bytes. $ df -k Filesystem           1K-blocks  &n… Read More
  • diff diff command examples Ignore white space while comparing. # diff -w name_list.txt name_list_new.txt  2c2,3 < John Doe --- > John M Doe > Jason Bourne Normal 0 false… Read More
  • date date command examples Set the system date: $ date -s "01/31/2010 23:59:53" Once you’ve changed the system date, you should syncronize the hardware clock with the system date as shown below. $ hwcloc… Read More
  • A-Z Index of the Mostly used Bash command line for Linux A      awk B      bzip2 C      cd       |     crontab  … Read More
  • chown chown command examples chown command is used to change the owner and group of a file. To change owner to oracle and group to db on a file. i.e Change both owner and group at the same… Read More

0 comments:

Post a Comment