Write the command that will disable password aging for a specific
Linux user account.
hi
# usermod -L usrname
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).
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>
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!!!!
Here, pay attention to how to prevent account and password both from expiration using chage command :
thank you for the detailed explanation.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.