Question 700
A student has implemented the following configuration: A newly created shared work directory gives files unexpectedly broad default permissions. What repeatable control best reduces regressions or unsafe changes?
Explanation
Correct Answer
Apply a reviewed umask in the appropriate persistent login startup policy for the intended account. This guards against recurrence of: The umask removes requested permission bits when new filesystem objects are created. Confirm the lab's final state by: `umask` reports `0027`, while `stat -c %a /tmp/private-build/newfile` shows mode no broader than `640` for a normal creation.
Incorrect Answers
Maintain positive and negative sample cases for account naming validation. That control is best suited to a separate scenario: A text filter should identify accounts that start with `svc-` and end in a number but a simple substring rule admits unrelated names. It is not the best safeguard for the current mechanism: The umask removes requested permission bits when new filesystem objects are created.
Start scripted changes with an explicit `cd` guarded by failure checking and record the resolved target path. That control is best suited to a separate scenario: On a disposable RHEL 10 training host, an operator enters a nested work directory but later edits the wrong file because the current path was assumed. It is not the best safeguard for the current mechanism: The umask removes requested permission bits when new filesystem objects are created.
Use anchored regular expressions and independent sample positive/negative test lines. That control is best suited to a separate scenario: A lab report contains 5xx server responses mixed with successful lines; a student must count only lines beginning with an HTTP 5xx code. It is not the best safeguard for the current mechanism: The umask removes requested permission bits when new filesystem objects are created.