Courseiva
Administrative Tasks →mediumMultiple Choice

LPIC-1 Administrative Tasks Practice Question

A junior administrator needs to add a new user account named 'tester' to a Linux server. The account must have a home directory created at /home/tester, and the default shell should be set to /bin/bash. The administrator runs 'useradd tester' but later finds that no home directory was created and the shell is /bin/sh. Which command should have been used to meet both requirements?

⚠ Common exam trap

The trap here is assuming that useradd automatically creates a home directory; by default, it does not unless the -m option is given or the CREATE_HOME variable is set in /etc/login.defs.

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 -s /bin/bash tester

The correct command is useradd -m -s /bin/bash tester. The -m flag ensures the home directory is created, and -s specifies the login shell. Other options either fail to create the home directory, use non-standard syntax, or attempt to modify a non-existent user. This single command meets both stated requirements.

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 -m -s /bin/bash tester

    Why it's wrong here

    usermod modifies an existing user account, not creates a new one. The -m option with usermod moves the home directory content if the home directory is changed, but it does not create a new home directory for a user that lacks one. Since the user 'tester' does not exist yet, this command would fail. It is not suitable for initial account creation.

  • ✗

    useradd -d /home/tester -s /bin/bash tester

    Why it's wrong here

    The -d option only sets the home directory path in /etc/passwd; it does not create the directory. The directory must already exist or be created manually. While -s sets the shell correctly, the home directory would still be missing. This command fails to meet the requirement of creating the home directory automatically, so it is incorrect.

  • ✗

    adduser tester --home /home/tester --shell /bin/bash

    Why it's wrong here

    The adduser command is a higher-level interactive tool available on some distributions, but its options differ. --home and --shell are not standard adduser options in all Linux distributions; for example, Debian's adduser uses --home and --shell, but the syntax may vary. However, the question implies using useradd as the standard low-level command. This option is not universally correct and may fail on many systems.

  • ✓

    useradd -m -s /bin/bash tester

    Why this is correct

    The -m option instructs useradd to create the user's home directory if it does not exist, and -s /bin/bash sets the login shell to bash. This directly fulfills both requirements in a single command. Without -m, no home directory is created; without -s, the system default shell (often /bin/sh) is used. This is the correct and efficient solution.

About these practice questions

This LPIC-1 question is part of Courseiva's 402-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 and reviewed by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

Last reviewed September 2026 · checked against the official LPI exam blueprint

This LPIC-1 practice question is part of Courseiva's free LPI 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 LPIC-1 exam.