Question 190
In an introductory Linux course scenario, the class finds: A learner sets chmod 777 on a private script because it is the only number they remember, giving every user write access when only its owner needs to edit it. What is the principal cause of this result?
Explanation
Correct Answer
The technical basis is: Numeric Unix permission digits combine read 4, write 2 and execute 1 bits for owner, group and other classes. Resolve this through: Set a least-privilege numeric mode appropriate for the script's intended owner and authorized readers or executors. The expected evidence is: A long listing decodes to the intended owner, group and other permissions and an unauthorized account cannot modify the script.
Incorrect Answers
The /etc/skel directory conventionally supplies default initial home-directory content for user creation, separate from arbitrary existing home files. “Configure approved generic starter files in /etc/skel and create a disposable test user with the appropriate home creation settings” would remedy that alternative situation, but it would not correct the present issue: numeric Unix permission digits combine read 4, write 2 and execute 1 bits for owner, group and other classes.
“Apply the intended symbolic chmod change to remove other-read access while retaining necessary owner and group permissions” is the supported response when linux permission mode bits distinguish owner, group and other access and can be modified with symbolic chmod operations. Here the decisive response is “Set a least-privilege numeric mode appropriate for the script's intended owner and authorized readers or executors”, so that different intervention does not meet the stated requirement.
Configured local accounts and active login sessions are different records; tools such as who and w report current logged-in users. “Use who or w to inspect active sessions and separately consult account metadata for the list of created users” applies to that other condition. The reported evidence is a learner sets chmod 777 on a private script because it is the only number they remember, giving every user write access when only its owner needs to edit it; this alternative would address the wrong dependency.