cancel
Showing results for 
Search instead for 
Did you mean: 
Trevor
Starfighter Starfighter
Starfighter
  • 710 Views

Password Aging

Write the command that will disable password aging for a specific
Linux user account.

 

Trevor "Red Hat Evangelist" Chandler
6 Replies
Maximus_el
Mission Specialist
Mission Specialist
  • 690 Views

hi

# usermod -L usrname

________________________________________________________
Keep fighting, peacefully!
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 684 Views

I suppose that, yes, this will "prevent password aging."

It will also prevent the user from being able to log in (and is equivalent to # passwd -l user).

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 683 Views

If you mean that you do not want the password from expriring (aging out), you could use:

# chage -M 99999 <username>

99999, incidentally, is the default value, derived from the /etc/login.defs file when the user account is created (which can be set to something different by changing PASS_MAX_DAYS in the file).

It's 99,999 days - 274.78 years - so, unless you wanna live for another 274.78 years, it effectively means your password will never expire.

update: I just double checked the man pages for chage, and it says this, "Passing the number -1 as MAX_DAYS will remove cheching a password's validity," so this appears to be the better coice (in case I do live longer than 274.78 years):

# chage -M -1 <username>

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
Trevor
Starfighter Starfighter
Starfighter
  • 599 Views

Once again you saved me some keystrokes in typing the 
answer Tracy.

Your chage   -M   99999  <username>  command is the direction
I was trying to lead folks!!!

Thanks for doing my work!!!!

Trevor "Red Hat Evangelist" Chandler
Chetan_Tiwary_
Community Manager
Community Manager
  • 665 Views

Here, pay attention to how to prevent account and password both  from expiration using chage command :

Chetan_Tiwary__0-1728752065494.png

 

Maximus_el
Mission Specialist
Mission Specialist
  • 658 Views

thank you for the detailed explanation.

________________________________________________________
Keep fighting, peacefully!
Join the discussion
You must log in to join this conversation.