🎓 BookMCQ
← Back to 14. Protection

📝 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.
2
Easy
6
Medium
4
Hard

📝 All UNIX example of protection in Operating System MCQs

Q1. What is the principle of least privilege?

A.Grant all users full system rights
B.Give each user only the rights needed to perform their tasks ✅
C.Allow users to share passwords
D.Disable all user accounts
💡 Difficulty: easy | ✅ Correct: B

📖 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?

A.It automatically grants all permissions to every role
B.It groups users so they share the same password
C.It assigns specific permissions to each role based on job functions ✅
D.It removes the need for any access control lists
💡 Difficulty: medium | ✅ Correct: C

📖 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?

A.Give the operator root access and trust they will not change settings
B.Create a separate account with only tape‑mount and copy commands permitted ✅
C.Allow the operator to use sudo for any command when needed
D.Provide no account and require the operator to work as a guest
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.They record every privileged call and who invoked it ✅
B.They automatically block any privileged command
C.They encrypt all system logs so no one can read them
D.They replace the need for access control lists
💡 Difficulty: hard | ✅ Correct: A

📖 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?

A.Give the admin permanent root rights
B.Use sudo to allow the mount command only for the needed session ✅
C.Create a new user with full root access
D.Disable all logging during the operation
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.Set the file owner to root and give everyone write permission
B.Apply an access control list that grants read rights to the developers group ✅
C.Create a new role that includes write permission for the library
D.Remove all permissions from the file
💡 Difficulty: medium | ✅ Correct: B

📖 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?

A.Solaris removes all network services by default
B.Solaris adds more code than Windows 2000, making it harder to exploit
C.Solaris implements stricter default permissions and integrates audit mechanisms ✅
D.Solaris runs only on proprietary hardware that cannot be attacked
💡 Difficulty: hard | ✅ Correct: C

📖 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?

A.Delete the log entry to protect privacy
B.Assume the user is authorized and take no action
C.Correlate the entry with other logs to determine the context and possible impact ✅
D.Immediately shut down the entire system
💡 Difficulty: hard | ✅ Correct: C

📖 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?

A.Enable the service all day and rely on firewall rules to block external IPs
B.Disable the service and never re‑enable it
C.Use a cron job to start the service at 9 PM and stop it at 5 AM, combined with firewall rules restricting IP ranges ✅
D.Allow any user to start the service manually at any time
💡 Difficulty: medium | ✅ Correct: C

📖 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?

A.ACLs replace RBAC entirely by assigning permissions to individual users
B.ACLs provide fine‑grained permissions for objects that RBAC cannot express at the role level ✅
C.ACLs make RBAC unnecessary because they are more flexible
D.ACLs and RBAC are unrelated and cannot be used together
💡 Difficulty: hard | ✅ Correct: B

📖 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?

A.chmod 777 /protected/file; cp /protected/file /tmp/; chmod 644 /protected/file
B.Use setuid root on the script and run it directly
C.Run the script with sudo for the copy operation only, then exit ✅
D.Copy the file as root and never change permissions again
💡 Difficulty: medium | ✅ Correct: C

📖 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?

A.A list of user passwords stored in plain text
B.A chronological record of security‑related events and actions
C.A set of firewall rules that block all traffic ✅
D.A backup of all user files
💡 Difficulty: easy | ✅ Correct: C

📖 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.

🔗 Related Topics (MCQs)