cancel
Showing results for 
Search instead for 
Did you mean: 
AmeyaSathe
Mission Specialist
Mission Specialist
  • 4,453 Views

Set accounts to expire in 90 days from the current day

Jump to solution

RH199R - ch03s11. Guided exercise.

Instruction is " Set the consultant1consultant2, 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?

 

1 Solution

Accepted Solutions
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 4,435 Views

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:
1.JPG

2: using chage -E and checking:
2.JPG

3: using usermod -e and checking:
3.JPG

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.)

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College

View solution in original post

5 Replies
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 4,436 Views

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:
1.JPG

2: using chage -E and checking:
2.JPG

3: using usermod -e and checking:
3.JPG

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.)

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
AmeyaSathe
Mission Specialist
Mission Specialist
  • 4,216 Views

Thank you.

0 Kudos
bball
Flight Engineer
Flight Engineer
  • 3,959 Views

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. 

0 Kudos
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 3,950 Views

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.

Program Lead at Arizona's first Red Hat Academy, est. 2005
Estrella Mountain Community College
0 Kudos
bball
Flight Engineer
Flight Engineer
  • 3,950 Views
Thank you. That is the answer I was hoping for. With so many ways to accomplish tasks in Linux, it makes sense that the end result is the most important thing.

Brian Ball
IT Applications Analyst
[cid:image001.jpg@01D8ACAD.B3026D30]
QSS Help Line: (209) 381-5950
Desk Phone: (209) 381-5936
bball@mcoe.org

This communication contains information which may be confidential. The information is intended only for the use of the individual or entity named above. If you are not the intended recipient, you should notify the sender named above and delete this communication from your computer. You are hereby notified that any disclosure, copying, distribution, or the taking of any action in reliance on the contents of said information is strictly prohibited.
0 Kudos
Join the discussion
You must log in to join this conversation.