Which command sequence creates a new user with a home directory and adds it to the wheel group, then prompts to set a password?

Prepare for the Red Hat Certified Systems Admin Exam EX200. Enhance your skills with interactive quizzes, flashcards, and detailed explanations. Ace your certification exam today!

Multiple Choice

Which command sequence creates a new user with a home directory and adds it to the wheel group, then prompts to set a password?

Explanation:
To create a new user with a home directory, put them in the wheel group, and then set a password, you rely on specific user management options: -m creates the home directory, and -G wheel adds the user to the wheel group. After the account is created, running passwd for that user prompts you to set their password. The sequence useradd -m -G wheel username; passwd username does exactly that: it ensures a home directory exists, grants wheel group membership (which on many systems enables sudo privileges), and then prompts for a password. The other options miss at least one requirement: one uses a nonstandard tool for Red Hat, another omits creating the home directory by not using -m with -d, and another uses a command not used for Linux user management.

To create a new user with a home directory, put them in the wheel group, and then set a password, you rely on specific user management options: -m creates the home directory, and -G wheel adds the user to the wheel group. After the account is created, running passwd for that user prompts you to set their password. The sequence useradd -m -G wheel username; passwd username does exactly that: it ensures a home directory exists, grants wheel group membership (which on many systems enables sudo privileges), and then prompts for a password. The other options miss at least one requirement: one uses a nonstandard tool for Red Hat, another omits creating the home directory by not using -m with -d, and another uses a command not used for Linux user management.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy