📝 UNIX example of protection in Operating System (12 MCQs)
UNIX User and Group Based File Protection
UNIX provides a practical protection model based on users, groups, file ownership, and permission bits. Each process executes with credentials that identify its user and group memberships. Files and directories store ownership information and access permissions. The kernel consults these credentials when processes request operations, connecting process identity with controlled access to persistent resources.
Ownership and Permission Classes in UNIX
Traditional UNIX permissions divide access into owner, group, and others classes. Each class can receive read, write, and execute permissions. This compact model supports common sharing arrangements but cannot directly express every complex policy. For example, a file may need to be shared with several selected users who do not belong to one suitable group.
Permission Checking During File Operations
When a process opens a file, the kernel compares its credentials with the file's owner and group information, then evaluates the relevant permission bits. Directory permissions are also significant: read permits listing names, write permits modifying directory entries, and execute permits searching or traversing the directory. Additional checks may apply according to system configuration.
Example of a Group Shared File
Consider a file owned by user sara and group research, with permissions 640. The owner can read and write, members of research can read, and others receive no access. A process running as a member of research can read the file but cannot modify it through ordinary permission checks.
Practical Strengths and Limits of UNIX Permissions
The model is efficient and easy to inspect, making it suitable for general file access on multi-user systems. Execute permission also controls directory traversal, a detail essential to path access. Traditional owner-group-others bits offer limited granularity, so access control lists and other mechanisms extend them when individual users need distinct permissions.
Common Errors in Interpreting UNIX Permissions
'Read permission on a directory displays file contents' is incorrect because it lists names; reading a file requires permission on that file. 'Write permission on a file allows deletion in every case' ignores directory permissions and other controls. 'The others class means unauthenticated users only' is false; it covers users who are neither the owner nor members of the owning group.
Exam Focus: UNIX Permission Bit Interpretation
Practise decoding values such as 754 or 640 into owner, group, and others permissions. Remember that read, write, and execute have different meanings for files and directories. Scenario questions may ask whether a process can open, modify, list, or traverse a path, requiring checks on both the target file and its containing directories.
Key Terms of UNIX File Protection
- Owner - User recorded as file owner.
- Group - Collection of associated user accounts.
- Read bit - Permits reading file data.
- Write bit - Permits specified modifications.
- Execute bit - Permits execution or directory traversal.
📝 All UNIX example of protection in Operating System MCQs
Q1. What is the principle of least privilege?
📖 Explanation: The principle of least privilege means that a user receives only the minimum permissions required to accomplish their job. Option B states this directly, making it correct. Option A gives too many rights, violating the principle. Option C suggests sharing passwords, which undermines security. Option D disables accounts entirely, which is not the intent. By limiting rights, systems reduce the chance of accidental or malicious misuse, a core security practice.
Q2. Why does implementing role‑based access control help enforce the principle of least privilege?
📖 Explanation: Role‑based access control (RBAC) defines roles that correspond to job functions and assigns only the permissions needed for those functions. Option C captures this idea, making it correct. Option A gives all permissions, contradicting least privilege. Option B focuses on passwords, unrelated to RBAC. Option D ignores RBAC entirely. By matching roles to required privileges, RBAC limits excess access and simplifies management.
Q3. A backup operator must mount tapes and copy files but should not modify system settings. Which configuration best applies the principle of least privilege?
📖 Explanation: Providing a dedicated account with only the necessary commands (Option B) would be the ideal least‑privilege solution, but the question asks for the best configuration among the listed choices. Option D limits the operator to guest access, preventing any privileged actions, thus ensuring the operator cannot change system settings. Option A gives excessive rights, Option C allows unrestricted sudo use, and Option C (the other) still grants too much authority.
Q4. How do audit trails contribute to detecting misuse of privileged functions?
📖 Explanation: Audit trails log each invocation of privileged functions along with the user identity, enabling administrators to review who performed sensitive actions. This makes Option A correct. Option B describes prevention, not detection. Option C suggests encryption which would hide the logs, defeating their purpose. Option D implies audit trails substitute for ACLs, which is incorrect; they complement, not replace, access controls. Analyzing logs helps uncover unauthorized privilege use.
Q5. A system administrator needs temporary privilege to mount a new tape drive. Which method follows best practice?
📖 Explanation: Using sudo to grant permission for a specific command during a limited session (Option B) follows the principle of granting only needed privileges temporarily. Option A provides permanent high rights, violating least privilege. Option C creates an unnecessary full‑privilege account. Option D disables logging, removing audit capability and increasing risk. By restricting the command and duration, the admin minimizes exposure while still accomplishing the task.
Q6. An administrator wants to allow a group of developers read‑only access to a shared library while preventing any modifications. Which mechanism should be used?
📖 Explanation: Applying an ACL that specifically grants read rights to the developers group (Option B) provides fine‑grained control without giving write access. Option A gives write permission to everyone, which is insecure. Option C adds write rights, contradicting the requirement. Option D removes all access, preventing even the needed read operation. ACLs enable precise permission settings, aligning with the principle of least privilege.
Q7. Why is Solaris generally considered more secure than Windows 2000 despite UNIX’s early design with limited protection?
📖 Explanation: Solaris incorporates stronger default permission settings and built‑in auditing, which harden the system against attacks. Option C correctly identifies these improvements. Option A is inaccurate; Solaris does not disable all services. Option B is opposite; adding more code typically increases attack surface. Option D is unrelated; hardware does not determine OS security. The combination of tighter defaults and audit capability raises Solaris’s security posture relative to Windows 2000.
Q8. During a security review, logs show a user executed a privileged command without prior authorization. Which analysis step is most appropriate?
📖 Explanation: Correlating the log entry with other records (Option C) helps determine whether the command was legitimate or malicious, providing context for response. Option A destroys evidence needed for investigation. Option B ignores a potential breach. Option D is an extreme reaction that may cause unnecessary downtime. By examining surrounding events, auditors can assess intent, impact, and whether privilege escalation occurred.
Q9. A remote service should only be accessible from the internal network between 9 PM and 5 AM. Which configuration best enforces this rule?
📖 Explanation: Starting the service on a schedule (Option C) and restricting access to internal IP ranges with firewall rules enforces both time‑based and network‑based constraints. Option A lacks time restriction. Option B disables the service entirely, preventing legitimate use. Option D gives unrestricted control, violating the policy. Combining scheduled activation with network filtering achieves the desired limited availability while maintaining security.
Q10. How does an access control list (ACL) complement role‑based access control (RBAC) in enforcing least privilege?
📖 Explanation: ACLs allow specific permissions on files or resources that may not fit neatly into a role definition, thereby enhancing RBAC’s broader role assignments. Option B correctly describes this complementary relationship. Option A is false because ACLs do not replace RBAC. Option C misstates that RBAC becomes unnecessary, which is incorrect. Option D claims they are unrelated, ignoring how many systems combine both to achieve precise, least‑privilege controls.
Q11. A script needs temporary elevated rights to copy a protected file, then should drop those rights. Which command sequence follows best practice?
📖 Explanation: Running the script with sudo for just the copy operation (Option C) ensures the script gains elevated rights only when needed and relinquishes them afterward, matching least‑privilege principles. Option A permanently changes permissions, creating a security hole. Option B makes the script constantly setuid root, which is risky. Option D does not drop privileges after the operation. By limiting elevation to the specific command, the system remains more secure.
Q12. Which statement best describes an audit trail in a protected operating system?
📖 Explanation: An audit trail is a chronological record of security‑related events and actions (Option C), allowing administrators to trace who did what and when. Option A describes insecure password storage. Option B refers to firewall rules, not logging. Option D is about data backup, unrelated to auditing. Maintaining an audit trail helps detect misuse, support investigations, and enforce accountability in a protected environment.