Red Hat Certified System Administrator RHCSA · Free Practice Question Medium

Question 36

Develop a script for Red Hat Enterprise Linux 9 that accomplishes the following tasks:

  1. Create a new user called 'new_user', ensuring they have a home directory located at /home/new_user and a default shell set to /bin/bash.

  2. Grant 'new_user' sudo privileges.

  3. Verify if a symbolic link named 'symlink' to the file /etc/passwd already exists. If it does not, create this symbolic link.

Show model answer

This script uses useradd to create a new user, edits the /etc/sudoers file for sudo privileges, and creates a symbolic link if it doesn't already exist.

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