Red Hat Certified System Administrator RHCSA · Free Practice Question Hard

Question 28

Develop a script suitable for Red Hat Enterprise Linux 9 (RHEL 9) that accomplishes the following tasks:

  1. Creates a new user account named 'new_user'.

  2. Assigns '/home/new_user' as the home directory for this account.

  3. Sets '/bin/bash' as the default shell for 'new_user'.

  4. Grants 'new_user' sudo privileges. Ensure your script adheres to the best practices for user management in RHEL 9.

Show model answer

This script uses useradd to create a new user 'new_user' with a specified home directory and shell. It then grants sudo privileges by adding a new file in '/etc/sudoers.d/' for 'new_user', following RHEL 9's best practices for user management and sudo configuration.

Discussion

Think the marked answer is wrong, or have a better explanation? Share it below — comments appear after review.

You must be logged in to post a comment.

Preparing For

Your Certification?

255+ certifications
Detailed explanations
Free PDF samples

Has All The Questions You Need