Bird
0
0

You run useradd -m john but the home directory is not created. What is the likely cause?

medium📝 Debug Q6 of 15
Linux CLI - Users and Groups
You run useradd -m john but the home directory is not created. What is the likely cause?
AThe system has no disk space
BThe <code>-m</code> option was misspelled
CThe user already exists
DThe <code>/etc/default/useradd</code> file has HOME variable unset
Step-by-Step Solution
Solution:
  1. Step 1: Check useradd configuration

    The /etc/default/useradd file defines default home directory base. If HOME is unset or incorrect, -m may fail to create the directory.
  2. Step 2: Consider other options

    Misspelling -m would cause a syntax error, existing user would cause useradd to fail, and disk space issues cause different errors.
  3. Final Answer:

    The /etc/default/useradd file has HOME variable unset -> Option D
  4. Quick Check:

    Unset HOME in config stops home dir creation [OK]
Quick Trick: Check /etc/default/useradd HOME variable if home missing [OK]
Common Mistakes:
  • Ignoring config file settings
  • Assuming misspelled option always causes error
  • Not checking disk space

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Linux CLI Quizzes