Red Hat Certified System Administrator RHCSA · Free Practice Question Medium

Question 40

Using Red Hat Enterprise Linux 9, create a directory named 'friends' within the /tmp directory. Then, change the directory's ownership to the 'friends' group. Configure the directory permissions so that only members of the 'friends' group and the root user can access this directory.

Show model answer

First, create the directory with mkdir /tmp/friends. Then, to change the group ownership, use chgrp friends /tmp/friends. Finally, set the directory permissions so only the group members and root can access it using chmod 770 /tmp/friends. This assigns full permissions (read, write, execute) to the owner and group, and no permissions to others. The '770' permission ensures that only users in the 'friends' group and the root user can access the directory.

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