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:

  • wget   wget command examples The quick and effective method to download software, music, video from internet is using wget command. $ wget http://prdownloads.sourceforge.net/sourceforge/nagios/nagios-3.2.1.tar.gz … Read More
  • xargs   xargs command examples Copy all images to external hard-drive # ls *.jpg | xargs -n1 -i cp {} /external-hard-drive/directory Search all jpg images in the system and archive it. # find / -name *.jpg -type… Read More
  • history   history command example Linux bash history keeps every command a user typed in the command line terminal into a file named .bash_history. Here is an example of Linux history command with no option running i… Read More
  • whatis    whatis command examples Whatis command displays a single line description about a command. $ whatis ls ls             (1)  - list directo… Read More
  • yum yum command examples To install apache using yum. $ yum install httpd To upgrade apache using yum. $ yum update httpd To uninstall/remove apache using yum. $ yum remove httpd … Read More

0 comments:

Post a Comment