RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1183638 - Issue using chage command to remove account expiration date.
Summary: Issue using chage command to remove account expiration date.
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: shadow-utils
Version: 6.6
Hardware: All
OS: Linux
urgent
urgent
Target Milestone: rc
: ---
Assignee: Tomas Mraz
QA Contact: BaseOS QE Security Team
URL:
Whiteboard:
: 1183993 1184184 (view as bug list)
Depends On:
Blocks: 1206273
TreeView+ depends on / blocked
 
Reported: 2015-01-19 11:11 UTC by Chinmay Paradkar
Modified: 2019-08-15 04:12 UTC (History)
9 users (show)

Fixed In Version: shadow-utils-4.1.4.2-20.el6
Doc Type: Bug Fix
Doc Text:
Previously, the system administrator could not remove the account expiration date and the date of the last password change using the "chage -E -1" and "chage -d -1" commands. The bug in the "date" parsing code has been fixed, and it is again possible to remove the account expiration date and the date of the last password change using the aforementioned commands.
Clone Of:
: 1206273 (view as bug list)
Environment:
Last Closed: 2015-10-22 09:35:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Chinmay Paradkar 2015-01-19 11:11:50 UTC
Description of problem:

Issue using chage command to remove Account expiration date. The year format in "Account expires" is wrong.

Version-Release number of selected component (if applicable):

shadow-utils-4.1.4.2-19.el6.x86_64

How reproducible:
This issue is reproducible with shadow-utils-4.1.4.2-19.el6.x86_64 package on RHEL-6.5 and RHEL-6.6.

Steps to Reproduce:

# chage -l friday
Last password change                                    : Jan 19, 2015
Password expires					: never
Password inactive  					: never
Account expires 					: never
Minimum number of days between password change   	: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires 	: 7

# chage -E -1 friday

Actual results:

# chage -l friday
Last password change					: Jan 19, 2015
Password expires 					: never
Password inactive					: never
Account expires						: Jan 20, 11761191
Minimum number of days between password change 		: 0
Maximum number of days between password change 		: 99999
Number of days of warning before password expires	: 7

Expected results:

# chage -l friday
Last password change					: Jan 19, 2015
Password expires 					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change 		: 0
Maximum number of days between password change 		: 99999
Number of days of warning before password expires	: 7

Additional info:

I have noted the entry "-2" is added in 8th column of "/etc/shadow" file.

# grep friday /etc/shadow
friday:$6$dBs1aWNG$ahInXkaUiM20opsZCGuvjRcUedH3iGVG3Fv3LzfuhR.3qgHvBbgNyyFlhiT/HOo8XRC7ZieHkwCMTMUqHmZdA/:16454:0:99999:7::-2:

The workaround for this is to manually edit the configuration file "/etc/shadow" and remove the entry "-2", it will reset the value for "Account expires" to default.

Comment 3 Tomas Mraz 2015-01-20 17:11:44 UTC
You can use
chage -d '' <account>
instead of editing the file manually.

Comment 4 Tomas Mraz 2015-01-20 17:12:45 UTC
I meant use
chage -E '' <account>
of course.

Comment 5 Chinmay Paradkar 2015-01-21 02:20:29 UTC
1) Running "chage" for a new user:

# chage -l chinmay
Last password change					: Jan 21, 2015
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change 		: 0
Maximum number of days between password change 		: 99999
Number of days of warning before password expires 	: 7

2) Removing account expiration date.

# chage -E -1 chinmay

# chage -l chinmay
Last password change 					: Jan 21, 2015
Password expires				        : never
Password inactive					: never
Account expires						: Jan 20, 11761191
Minimum number of days between password change 		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7

3) Testing the command with provided option. 

# chage -E '' chinmay
chage: invalid date ''
Usage: chage [options] [LOGIN]

Options:
  -d, --lastday LAST_DAY        set date of last password change to LAST_DAY
  -E, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -h, --help                    display this help message and exit
  -I, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -l, --list                    show account aging information
  -m, --mindays MIN_DAYS        set minimum number of days before password
                                change to MIN_DAYS
  -M, --maxdays MAX_DAYS        set maximim number of days before password
                                change to MAX_DAYS
  -W, --warndays WARN_DAYS      set expiration warning days to WARN_DAYS

# chage -E ' ' chinmay

# chage -l chinmay
Last password change					: Jan 21, 2015
Password expires					: never
Password inactive					: never
Account expires						: Jan 21, 2015
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7

The above command causes the account to expire immediately, instead of removing the account expiration date.

Comment 12 Tomas Mraz 2015-03-25 18:01:59 UTC
*** Bug 1184184 has been marked as a duplicate of this bug. ***

Comment 13 Tomas Mraz 2015-03-25 18:02:03 UTC
*** Bug 1183993 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.