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