Courseiva
easyMultiple ChoiceObjective-mapped

XK0-006 Practice Question: A new user 'jdoe' has been added using the…

A new user 'jdoe' has been added using the command 'useradd jdoe', but upon first login, the user receives a message that the home directory does not exist. Which command should the administrator run to resolve this issue while also populating the home directory with default skeleton files?

⚠ Common exam trap

Many exam-takers think `usermod -d` (Option C) will both set and create the home directory, but it only updates the path in `/etc/passwd` without creating the directory or copying skeleton files, which is a common misconception in Linux user management.

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

useradd -m jdoe

The `useradd -m jdoe` command creates the user's home directory and copies the default skeleton files from `/etc/skel` into it. Since the user was initially created without the `-m` flag, the home directory was not created, causing the login error. Running `useradd -m` on an existing user will create the missing home directory and populate it with skeleton files, resolving the issue.

Answer analysis

Option-by-option breakdown

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

  • chown jdoe:jdoe /home/jdoe

    Why it's wrong here

    This only changes ownership; the directory does not exist yet.

  • mkdir /home/jdoe; cp /etc/skel/* /home/jdoe/

    Why it's wrong here

    This manually creates the directory and copies files, but it is not the standard tool and may miss file permissions or extended attributes.

  • usermod -d /home/jdoe jdoe

    Why it's wrong here

    This only changes the home directory path in /etc/passwd; the directory may not exist and skeleton files are not copied.

  • useradd -m jdoe

    Why this is correct

    The -m flag creates the home directory and copies skeleton files from /etc/skel.

Visual reference

Client Recursive Resolver Root DNS (13 root servers) TLD DNS (.com, .org, …) Authoritative example.com query IP addr answer

About these practice questions

This XK0-006 question is part of Courseiva's 979-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. 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 XK0-006 practice question is part of Courseiva's free CompTIA 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 XK0-006 exam.