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:

  • kill kill command examples Use kill command to terminate a process. First get the process id using ps -ef command, then use kill -9 to kill the running Linux process as shown below. You can also use killall, pkill, xkill … Read More
  • gzip   gzip command examples   To create a *.gz compressed file: $ gzip test.txt To uncompress a *.gz file: $ gzip -d test.txt.gz Display compression ratio of the compressed file using gzip -l $ … Read More
  • grep   grep command examples Search for a given string in a file (case in-sensitive search). $ grep -i "the" demo_file Print the matched line, along with the 3 lines after it. $ grep -A 3 -i "example" demo_te… Read More
  • free   free command examples This command is used to display the free, used, swap memory available in the system. Typical free command output. The output is displayed in bytes. $ free     &n… Read More
  • ifconfig ifconfig command examples Use ifconfig command to view or configure a network interface on the Linux system. View all the interfaces along with status. $ ifconfig -a Start or stop a specific interface using up and… Read More

0 comments:

Post a Comment