RHCSA RHCSA User and Group Management 4 — Questions and Answers
Question 1: Which command sets the account expiration date for user 'frank' to December 31, 2026?
- usermod -e 2026-12-31 frank
- chage -E 2026-12-31 frank
- passwd --expire 2026-12-31 frank
- Both A and B (Correct answer)
Correct answer: Both A and B
Both 'usermod -e' and 'chage -E' can set the account expiration date to a specific date.
Question 2: What UID range is typically reserved for system/service accounts on RHEL?
- 0-99
- 0-999 (Correct answer)
- 1-499
- 1000-4999
Correct answer: 0-999
On RHEL, UIDs 0-999 are reserved for system accounts, with regular users starting at UID 1000 by default.
Question 3: An admin wants to lock user 'grace' from logging in without deleting her account. Which command does this?
- usermod -L grace
- passwd -l grace
- chage -E 0 grace
- Both A and B (Correct answer)
Correct answer: Both A and B
Both 'usermod -L' and 'passwd -l' lock an account by prepending '!' to the password hash in /etc/shadow.
Question 4: Which command would display detailed password aging information for user 'helen'?
- passwd -S helen
- chage -l helen (Correct answer)
- getent shadow helen
- cat /etc/shadow | grep helen
Correct answer: chage -l helen
chage -l provides a human-readable summary of all password aging attributes for a user.
Question 5: When using 'newgrp finance', what effect does this have on the current shell session?
- Adds 'finance' as a permanent supplementary group
- Starts a new shell with 'finance' as the effective primary group (Correct answer)
- Removes the user from their current primary group
- Grants root-level access to the finance group files
Correct answer: Starts a new shell with 'finance' as the effective primary group
newgrp starts a new subshell where the specified group becomes the effective primary group for file creation.
Question 6: What does the command 'gpasswd -d ivan admins' do?
- Deletes the 'admins' group entirely
- Removes user 'ivan' from the 'admins' group (Correct answer)
- Sets 'ivan' as the group administrator of 'admins'
- Changes the 'admins' group password
Correct answer: Removes user 'ivan' from the 'admins' group
gpasswd -d removes (deletes) a user from the specified group.
Question 7: Which configuration file defines the minimum and maximum UID values for regular users created by useradd?
- /etc/default/useradd
- /etc/login.defs (Correct answer)
- /etc/security/limits.conf
- /etc/passwd
Correct answer: /etc/login.defs
/etc/login.defs contains UID_MIN and UID_MAX that define the valid UID range for regular user accounts.
Which command sets the account expiration date for user 'frank' to December 31, 2026?