On a RHEL 9 server, the HR department has requested that you remove the local user account jane as part of the off-boarding procedure. Company policy states:
The user's home directory and local mail spool must be deleted.
Project files stored on shared file systems mounted under /srv must be left intact for auditing.
Forced deletion of accounts that might still be logged in is prohibited.
Only the standard shadow-utils package is installed; no higher-level wrappers such as deluser are available.
Which single command meets all of these requirements?
The userdel utility is part of the shadow-utils package available on every RHEL system. Using the -r (or --remove) option deletes the account, the user's home directory, and the mail spool while leaving any other files the user owns on separate file systems untouched. The -f (force) option also removes the account and files but violates the company's prohibition on forced deletions. Commands that rely on the Debian deluser script are not present on a stock RHEL installation, and groupdel would only delete a group, not the user account itself. Therefore, userdel -r jane is the only command that satisfies every stated requirement.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What does the userdel command do in Linux?
Open an interactive chat with Bash
Why is the -r option necessary when using userdel?
Open an interactive chat with Bash
What is the significance of avoiding forced deletions with the -f option?
Open an interactive chat with Bash
CompTIA Linux+ XK0-006 (V8)
Services and User Management
Your Score:
Report Issue
Bash, the Crucial Exams Chat Bot
AI Bot
Loading...
Loading...
Loading...
IT & Cybersecurity Package Join Premium for Full Access