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:

  • rm   rm command examples Get confirmation before removing the file. $ rm -i filename.txt It is very useful while giving shell metacharacters in the file name argument. Print the filename and get conf… Read More
  • ssh   ssh command examples  Login to remote host ssh -l jsmith remotehost.example.com Debug ssh client ssh -v -l jsmith remotehost.example.com Display ssh client version $ ssh -V OpenSSH_3.9p1, OpenSSL 0.… Read More
  • sort  sort command examples Sort a file in ascending order $ sort names.txt Sort a file in descending order $ sort -r names.txt Sort passwd file by 3rd field. $ sort -t: -k 3n /etc/passwd | more … Read More
  • sed   sed command examples When you copy a DOS file to Unix, you could find \r\n in the end of each line. This example converts the DOS file format to Unix file format using sed command. $sed 's/.$//' filename … Read More
  • rpm   rpm command example   To install apache using rpm. # rpm -ivh httpd-2.2.3-22.0.1.el5.i386.rpm To upgrade apache using rpm. # rpm -uvh httpd-2.2.3-22.0.1.el5.i386.rpm To uninstall/remove apache using rp… Read More

0 comments:

Post a Comment