Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
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 1508463

Summary: Add small example to 'chage' documentation
Product: Red Hat Enterprise Linux 7 Reporter: Lev Ufimtsev <lufimtse>
Component: shadow-utilsAssignee: Tomas Mraz <tmraz>
Status: CLOSED ERRATA QA Contact: Jaroslav Aster <jaster>
Severity: low Docs Contact:
Priority: unspecified    
Version: 7.6-AltCC: dapospis, jaster, nmavrogi
Target Milestone: rcKeywords: Documentation
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: shadow-utils-4.1.5.1-25.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1610350 (view as bug list) Environment:
Last Closed: 2018-10-30 08:04:11 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1563599    

Description Lev Ufimtsev 2017-11-01 13:37:31 UTC
I've come across this while taking the RHCSA course.

The suggestion is to add a little bit snippet to 'chage' documentation (chage = Change age).
(I could not find a 'chage' component, so I picked passwd)

The RHCSA book suggests that the following can be used to have an account expire in 180 days:
chage -E $(date -d +180days +%Y-%m-%d)

As it's tricky to memorize the syntax, may I suggest to add the example to the chage man page for future users?

I.e: the suggestion is to update the man page for the -E parameter:

Current documentation:
>     -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.

Proposed documentation: (see lines with '+')
>     -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). 
+>          For example the following can be used to set an account to expire in 180 days:
+>		chage -E $(date -d +180days +%Y-%m-%d)
>
>           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.
>

Comment 2 Miloslav Trmač 2017-11-01 16:17:02 UTC
For future reference:
> $ rpm -qf /usr/bin/chage
> shadow-utils-4.3.1-3.fc26.x86_64

Comment 3 Lev Ufimtsev 2017-11-02 13:50:00 UTC
(In reply to Miloslav Trmač from comment #2)
> For future reference:
> > $ rpm -qf /usr/bin/chage
> > shadow-utils-4.3.1-3.fc26.x86_64

Ah, thanks for tip!

Comment 8 errata-xmlrpc 2018-10-30 08:04:11 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2018:3063