Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 08-28-2012, 10:58 AM   #1
Registered: Jul 2010
Posts: 64

Rep: Reputation: 1
Wink How Allow root password to expire

Our government customer has expressed that our RHEL 5 root account must have an expiration date. He observed our /etc/shadow file and found that root account is set to 99999 (many many years). How can I safely set the root password to expire after 90 days?

A million thanks
Johnny Mac

Very new to Linux and don't want to mess up the root account
Old 08-28-2012, 11:07 AM   #2
Registered: Jul 2012
Distribution: Ubuntu
Posts: 198
Blog Entries: 3

Rep: Reputation: 23
Go through the man page of the shadown file

#man shadow

You will find all the details of the shadow fields.


Last edited by kedarp; 08-28-2012 at 11:11 AM.
Old 08-28-2012, 08:56 PM   #3
LQ Guru
Registered: Aug 2004
Location: Sydney
Distribution: Centos 7.7 (?), Centos 8.1
Posts: 18,078

Rep: Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665Reputation: 2665
-E, --expiredate EXPIRE_DATE
Set the date or number of days since January 1, 1970 on which the user's account will no longer be accessible. The date may also be expressed in the format YYYY-MM-DD (or the format more commonly used in your area). A user whose account is locked must contact the system administrator before being able to use the system again.

Passing the number -1 as the EXPIRE_DATE will remove an account expiration date.

-M, --maxdays MAX_DAYS
Set the maximum number of days during which a password is valid. When MAX_DAYS plus LAST_DAY is less than the current day, the user will be required to change his/her password before being able to use his/her account. This occurrence can be planned for in advance by use of the -W option, which provides the user with advance warning.

Passing the number -1 as MAX_DAYS will remove checking a password's validity.
Expire & duration are 2 different things...

See also for defaults
1 members found this post helpful.
Old 08-28-2012, 10:29 PM   #4
Registered: Jul 2012
Distribution: Ubuntu
Posts: 198
Blog Entries: 3

Rep: Reputation: 23
Yes, chage will write to the same shadow file. Thanks.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Root Password is expire automatically jitenderana Linux - Desktop 12 11-09-2011 12:45 AM
how expire password automatically manudath Linux - Security 2 04-27-2005 12:38 AM
samba password expire Peds222 Linux - Newbie 1 03-12-2005 04:34 PM
Warning: your password will expire in 0 days dragon Linux - Security 5 05-27-2004 02:53 AM
Samba -> Expire password Tiago Cruz Linux - Networking 6 03-05-2003 07:21 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:44 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration