Question 1
Lab exercise on an isolated enterprise lab VM: 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. Which proposed RHEL 10 command or configuration action most directly achieves the required lab state?
Explanation
Correct Answer
Run `pwd`, then `cd /srv/labs/projectA` after checking it exists; use absolute paths for the target edit. This directly addresses the lab target: 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. The underlying behavior is: A shell's relative paths are evaluated against its current working directory, not the operator's intended project. Verification: `pwd` reports `/srv/labs/projectA` and `realpath ./notes.txt` resolves inside that directory.
Incorrect Answers
Set a more restrictive shell umask such as `umask 027` in the test session before creating the sample file. This is an appropriate step for a DIFFERENT exercise, specifically: A newly created shared work directory gives files unexpectedly broad default permissions. It does not address the required lab state, whose mechanism is: A shell's relative paths are evaluated against its current working directory, not the operator's intended project.
Set `chmod 600 /home/student/.ssh/id_ed25519` after verifying correct ownership. This is an appropriate step for a DIFFERENT exercise, specifically: A private lab key file is incorrectly world-readable and must be accessible only to its owner. It does not address the required lab state, whose mechanism is: A shell's relative paths are evaluated against its current working directory, not the operator's intended project.
Use `tail -n 30 -f /tmp/labapp.log` to follow appended fixture events in a test terminal. This is an appropriate step for a DIFFERENT exercise, specifically: An operator follows a live application log but accidentally reads only the first ten lines during troubleshooting. It does not address the required lab state, whose mechanism is: A shell's relative paths are evaluated against its current working directory, not the operator's intended project.