In a container file, how do you set permissions on /app so its readable?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

In a container file, how do you set permissions on /app so its readable?

Explanation:
Setting the group to root and making the group permissions mirror the owner’s permissions is a precise way to control readability without blanketly exposing files. By changing the group ownership to root (root’s group) and then applying the same permission bits to the group as to the owner (g=u) recursively, you ensure that any user or process that has the owner’s rights also has the same rights for the group. In practice, if the owner can read a file or traverse a directory, the group will be able to do so too. This keeps access tight and predictable inside the container. Adding read for everyone (a+r) would make the contents readable to all users in the image, which is often more permissive than desired. The other options either perform unrelated edits (like a text replacement) or widen access by changing ownership and granting execute/read to others (as with 755), which isn’t as targeted for maintaining the same rights between owner and group.

Setting the group to root and making the group permissions mirror the owner’s permissions is a precise way to control readability without blanketly exposing files. By changing the group ownership to root (root’s group) and then applying the same permission bits to the group as to the owner (g=u) recursively, you ensure that any user or process that has the owner’s rights also has the same rights for the group. In practice, if the owner can read a file or traverse a directory, the group will be able to do so too. This keeps access tight and predictable inside the container.

Adding read for everyone (a+r) would make the contents readable to all users in the image, which is often more permissive than desired. The other options either perform unrelated edits (like a text replacement) or widen access by changing ownership and granting execute/read to others (as with 755), which isn’t as targeted for maintaining the same rights between owner and group.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy