Courseiva
Manage users and groups →mediumMultiple Choice

EX200 Manage users and groups Practice Question

A company policy requires that when a user is deleted, all files owned by that user in /home should be reassigned to a 'guest' account. Which command accomplishes this?

⚠ Common exam trap

Red Hat often tests the distinction between modifying user attributes (usermod), deleting users (userdel), copying files (rsync), and directly reassigning file ownership (find + chown), expecting candidates to recognize that only the latter changes ownership without altering or removing the files.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

✓

find /home -user olduser -exec chown guest {} +

Uses `find` to locate all files owned by `olduser` under `/home` and then executes `chown guest` on them, which reassigns ownership to the `guest` account. This directly satisfies the policy requirement without affecting the user account itself or copying files.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    usermod -l guest olduser

    Why it's wrong here

    usermod -l guest olduser only changes the login name in /etc/passwd; it does not alter the UID, and file ownership is tracked by UID, not by the login name. Files previously owned by olduser therefore remain associated with olduser's numeric UID, and if that UID does not match guest's UID, no files are actually reassigned. Moreover, the command does not delete the account at all, so it fails the policy's requirement to reassign all files upon deletion.

  • ✓

    find /home -user olduser -exec chown guest {} +

    Why this is correct

    find /home -user olduser -exec chown guest {} + is correct because it searches /home for every file whose owner matches the username olduser (which resolves to the UID) and executes chown guest on them in one batched command, thanks to the + terminator. This directly transfers ownership of each located file to guest, satisfying the policy efficiently. The find approach also covers files outside olduser's home directory that reside anywhere under /home, whereas other options only handle the home directory itself.

  • ✗

    userdel -r olduser

    Why it's wrong here

    userdel -r olduser does the opposite of reassigning files: the -r flag removes the user's home directory contents and mail spool, permanently destroying those files. It does not hand ownership of any files to guest; instead, any files in that home directory are deleted, and files elsewhere under /home that were owned by olduser remain orphaned. This violates both the policy to reassign all files and common retention requirements, making it an incorrect choice.

  • ✗

    rsync -a /home/olduser/ /home/guest/

    Why it's wrong here

    rsync -a /home/olduser/ /home/guest/ creates a duplicate copy of olduser's home directory contents under /home/guest, but it leaves the original files untouched and still owned by olduser. Even if rsync runs as root and preserves ownership on the copy, the source files are not reassigned, and any files outside the home directory are not addressed at all. This approach is about copying data, not about reassigning ownership of existing files upon account deletion.

About these practice questions

One of 427 original EX200 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This EX200 practice question is part of Courseiva's free Red Hat certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the EX200 exam.