At the end of last year, I took a training to prepare for Red Hat Certified System Administrator (RHCSA EX200) exam. Now it’s February and I haven’t taken the exam yet. Even worse, I forgot most of the things I learned during that 3 day training. Well, since I’m being chased to get this exam done ASAP, with a passing grade of course, I think now it’s the best time to start revising the material again. As part as the exam prep, I’m going to post small challenges and solutions.
I found a task of the day posted on CertDepot website, a very good resource to learn about Red Hat exam. So, let’s see if can I even do that. Here is the challenge:
**Allowed time: 5 minutes.
Create a new user account called “bob” with password “redhat” and set expiration in one week.**
My solution:
Time taken: 2 minutes 26 seconds.
I must admit the solution is not the most elegant, as I had to manually calculate 7th day’s date from today (2017-02-19).
Here’s another alternative solution according to this:
Update:
Another way to set the account expiry date is using chage
.