AmeyaSathe
Mission Specialist
Mission Specialist
  • 392 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
  • 374 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

2 Replies
Tracy_Baker
Starfighter Starfighter
Starfighter
  • 375 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
  • 155 Views

Thank you.

0 Kudos
Join the discussion
You must log in to join this conversation.