What command is used to add a new user to the system?

Prepare for the LPIC-2 Certification Test with our study tools, including flashcards and multiple choice questions with hints and explanations. Get ready to pass your exam!

The command to add a new user to the system is "useradd username". This command directly instructs the system to create a new user account with the specified username. It is a standard utility available in many Linux distributions and is the most basic command for user creation, allowing for different options to customize the new user’s settings.

Using this command creates a user account with default settings. However, it's important to understand that "useradd" alone does not automatically create a home directory for the user; that is typically a feature of the "-m" option, which tells the command to create the user's home directory upon account creation. Therefore, while option B is correct, utilizing option D (useradd -m username) would also result in adding a user with a home directory, offering more functionality.

In contrast, the command "adduser username" is often a front-end to "useradd" that may vary in implementation depending on the Linux distribution, sometimes providing more interactive prompts. The "newuser" command is not a standard command found in most Linux distributions, so it would not work for adding a user. It's beneficial to note these distinctions to understand the variations and options available when managing users in Linux.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy