How to turn Off linux password expiration?

by
Share this Article: Facebook0Google+1Twitter11LinkedIn0Reddit0StumbleUpon0

 Question : How to turn off password expiration under Linux?

Answer:

.

.

.

.

.

 

The  Encrypted password list is stored  in /etc/shadow file

cat /etc/shadow   root:$1$dkk&Iw6zvgu$P3ms0o5GiXv66BzNXe0:15294:0:99999:7:: 

This is the explanation of the above line

{userName}:{password}:{lastpasswdchanged}:{Minimum_days}:{Maximum_days}:{Warn}:{Inactive}:{Expire}:

Under Linux, to turn off the password expiration  we  use a  tool   called “chage” you  can  download it via yum  or  apt-get package  managers  tools.

  • For Debian based install chage using the command
apt-get install chage
  • For Fedora/RHEL based, install using the command:
yum install  chage

To disable password aging / expiration for user foo, type command as follows and set:

 Minimum Password Age to 0
 Maximum Password Age to 99999
 Password Inactive to -1
 Account Expiration Date to -1

Interactive mode command:

 # chage username

OR

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

For questions please refer to our Q/A forum at : http://ask.unixmen.com/

Share this Article: Facebook0Google+1Twitter11LinkedIn0Reddit0StumbleUpon0