RH199R - ch03s11. Guided exercise.
Instruction is " Set the consultant1, consultant2, and consultant3 accounts to expire in 90 days from the current day. "
Guided exercise expects me to use 'chage -E'. I used 'usermod -E' to ahieve the same.
What is the difference between these 2 commands? What are the applicable scenarios for each of them?
Other than the fact that your usermod command won't work? There is no -E option that can be used with usermod. The option to use is -e (not trying to be funny - just making the point that 99% of Linux is case sensitive).
Anyway, when you use the proper command and option, there is no difference:
1: Creating the bob account - checking the expiration date:
2: using chage -E and checking:
3: using usermod -e and checking:
Incidentally, these commands do the same thing as each other, too:
lock an account:
usermod -L <username> and passwd -l <username>
unlock an account:
usermod -U <username> and passwd -u <username>
(They kind-of do the same thing, but slightly differently - a distinction without a difference. usermod -L puts a single ! in front of the password hash in /etc/shadow [field #2] and passwd -l puts !! -- either way, the account is locked.)
Other than the fact that your usermod command won't work? There is no -E option that can be used with usermod. The option to use is -e (not trying to be funny - just making the point that 99% of Linux is case sensitive).
Anyway, when you use the proper command and option, there is no difference:
1: Creating the bob account - checking the expiration date:
2: using chage -E and checking:
3: using usermod -e and checking:
Incidentally, these commands do the same thing as each other, too:
lock an account:
usermod -L <username> and passwd -l <username>
unlock an account:
usermod -U <username> and passwd -u <username>
(They kind-of do the same thing, but slightly differently - a distinction without a difference. usermod -L puts a single ! in front of the password hash in /etc/shadow [field #2] and passwd -l puts !! -- either way, the account is locked.)
Thank you.
I have the exact same question from my Red Hat labs. So how would this be graded on the exam? I also used usermod -e.
I don't know how it is graded.
I can surmise: The Account expires line will be examined and, if the date is correct, then you've done it correctly.
In the end all that matters is that you've met the objective. It does not matter how you got there.
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.