RHCSA Rapid Track
In this lab, you will set unique password policies for users.
Outcomes
The password for romeo must be changed when the user first logs into the system, every 90 days thereafter, and the account expires in 180 days.
Perform the following steps on serverX unless directed otherwise.
Explore locking and unlocking accounts.
Lock the
romeoaccount.[student@serverX ~]$sudo usermod -L romeoAttempt to log in as
romeo.[student@serverX ~]$su - romeoPassword:romeosu: Authentication failureUnlock the
romeoaccount.[student@serverX ~]$sudo usermod -U romeo
Change the password policy for
romeoto require a new password every 90 days.[student@serverX ~]$sudo chage -M 90 romeo[student@serverX ~]$sudo chage -l romeoLast password change : Feb 03, 2014 Password expires : May 04, 2014 Password inactive : never Account expires : never Minimum number of days between password change : 0 Maximum number of days between password change : 90 Number of days of warning before password expires : 7Additionally, force a password change on the first login for the
romeoaccount.[student@serverX ~]$sudo chage -d 0 romeoLog in as
romeoand change the password toforsooth123.[student@serverX ~]$su - romeoPassword:romeoYou are required to change your password immediately (root enforced) Changing password for romeo.(current) UNIX password:romeoNew password:forsooth123Retype new password:forsooth123[romeo@serverX ~]$exitExpire accounts in the future.
Determine a date 180 days in the future.
[student@serverX ~]$date -d "+180 days"Sat Aug 2 17:05:20 EDT 2014Set accounts to expire on that date.
[student@serverX ~]$sudo chage -E2014-08-02romeo[student@serverX ~]$sudo chage -l romeoLast password change : Feb 03, 2014 Password expires : May 04, 2014 Password inactive : never Account expires : Aug 02, 2014 Minimum number of days between password change : 0 Maximum number of days between password change : 90 Number of days of warning before password expires : 7