LFCS Certification User and Group Management 3 — Questions and Answers
Question 1: A sysadmin runs 'groupmod -n webteam developers'. What is the result?
- The 'developers' group is deleted and replaced by 'webteam'
- The group named 'developers' is renamed to 'webteam' (Correct answer)
- Users in 'developers' are moved to 'webteam'
- A new group 'webteam' is created as a subgroup of 'developers'
Correct answer: The group named 'developers' is renamed to 'webteam'
groupmod -n new_name old_name renames the existing group without changing its GID or membership.
Question 2: Which /etc/login.defs parameter controls the default minimum number of days before a user can change their password?
- PASS_MAX_DAYS
- PASS_MIN_DAYS (Correct answer)
- PASS_WARN_AGE
- PASS_MIN_LEN
Correct answer: PASS_MIN_DAYS
PASS_MIN_DAYS in /etc/login.defs sets the system-wide default for the minimum number of days between password changes.
Question 3: How can you list all members of the 'sudo' group without opening /etc/group manually?
- usermod --list sudo
- getent group sudo (Correct answer)
- grouplist sudo
- lid -g sudo
Correct answer: getent group sudo
getent group sudo queries the group database (including NSS sources like LDAP) and displays the group entry including all members.
Question 4: A user's account is locked using 'passwd -l username'. Which character appears at the start of the password hash in /etc/shadow to indicate this?
- *
- ! (Correct answer)
- #
- 0
Correct answer: !
passwd -l prepends a '!' to the hashed password in /etc/shadow, preventing password-based authentication while leaving the hash intact.
Question 5: Which command would you use to view password aging information for a specific user?
- usermod -l username
- passwd --status username
- chage -l username (Correct answer)
- id --aging username
Correct answer: chage -l username
chage -l username displays all password aging fields — last change, minimum, maximum, warning, inactive, and expiry dates — in a human-readable format.
Question 6: What is the purpose of the /etc/skel directory?
- It stores skeleton passwords for new accounts
- Its contents are copied into a new user's home directory at account creation (Correct answer)
- It contains default group definitions
- It holds system account configurations
Correct answer: Its contents are copied into a new user's home directory at account creation
/etc/skel contains template files (e.g., .bashrc, .profile) that useradd copies into a new user's home directory when creating the account.
Question 7: An admin needs to delete a user and their home directory. Which command is correct?
- userdel username
- userdel -r username (Correct answer)
- usermod -d /dev/null username
- deluser --remove-home username
Correct answer: userdel -r username
userdel -r username removes the user's account, home directory, and mail spool in a single operation.
A sysadmin runs 'groupmod -n webteam developers'.
What is the result?