Which command creates a new user account named “jdoe” with a home directory in Linux? Learn why adduser jdoe is the recommended, interactive method for user creation—essential for CompTIA Linux+ (Plus) XK0-005 exam success.
Table of Contents
Question
Which command creates a new user account named “jdoe” with a home directory?
A. adduser jdoe
B. useradd jdoe
C. usermod -d /home/jdoe
D. passwd jdoe
E. mkdir /home/jdoe
Answer
A. adduser jdoe
Explanation
adduser jdoe interactively creates a user account, automatically setting up a home directory and prompting for a password, simplifying user management.
The command that creates a new user account named “jdoe” with a home directory is adduser jdoe.
The adduser command is a high-level, interactive utility available on many Linux distributions (especially Debian-based systems) that simplifies the process of creating a new user account.
When you run adduser jdoe, it:
- Creates the user account “jdoe”.
- Automatically creates a home directory at /home/jdoe.
- Copies default configuration files from /etc/skel into the new home directory.
- Prompts you to set a password for the new user and optionally fill in additional user information.
This process is more user-friendly than the lower-level useradd command, which requires the -m option to create a home directory and does not prompt for a password by default.
adduser is the recommended method for most administrators and exam scenarios when you want a fully configured, ready-to-use account with a home directory.
adduser jdoe interactively creates a new user with a home directory, password prompt, and default configuration, making it the standard choice for user management on many Linux systems.
CompTIA Linux+ (Plus) XK0-005 certification exam practice question and answer (Q&A) dump with detail explanation and reference available free, helpful to pass the CompTIA Linux+ (Plus) XK0-005 exam and earn CompTIA Linux+ (Plus) XK0-005 certification.