Files and permissions
Files, directories and permissions
A file is a named way to store or access data; a directory organizes names and paths. File metadata can include an owner, group and access permissions. Permissions describe which operations are permitted for a particular identity under the applicable policy. For a regular document, read means obtaining its content, write means changing content, and execute concerns running it as a program where applicable. These are distinct operations.
Work with an explicit access matrix
Use this fictional policy, not an actual OS configuration. For stock.csv, the Inventory group may read and write; the Catalog group may read only; other identities have neither permission. For price-policy.txt, Inventory may read only and Catalog has no access; other identities have neither permission. Assume exactly one group per identity and no administrator overrides. A catalog worker may read stock.csv but may not change it or read price-policy.txt. An inventory worker may update stock.csv but not price-policy.txt.
How real systems differ
Linux commonly records owner, group and mode bits for files. Additional access-control lists and security policies can change effective access. Directory permissions have different meanings: for example, search/traversal permission is important for accessing named files inside a directory. Windows uses its own security descriptors and access-control entries. Do not treat the fictional matrix as a complete implementation of either system, or assume that writing a file automatically grants permission to delete it; deletion depends on additional rules.
Make access fit the job
A price viewer needs to read published prices, not edit them. Giving it write access increases the potential impact of an error without enabling any necessary function. Conversely, denying its required read access would prevent legitimate work. Least privilege means granting sufficient, narrowly scoped access, then verifying both required allowed operations and operations that must be denied. Do not loosen all permissions simply because an application reports an access error.
Practice: review a document policy
A receptionist should read appointment-list.txt, while a scheduler should read and write it. The receptionist should have no access to payroll.txt. Draw three rows: receptionist reading appointments, receptionist writing appointments, receptionist reading payroll. Mark each allow or deny and explain the business purpose. This is a paper exercise, not a request to change OS permissions. Next: users and services.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Files and permissions — Knowledge check
Apply computing and operating system concepts to fictional reports.
In the lesson matrix, Catalog tries to read stock.csv. What is the decision?
Inventory tries to write price-policy.txt under the same matrix. What is the result?
A viewer needs to display prices but never edit them. What is the best permission choice?
Why does a real OS require more evidence than the toy matrix?
An application reports permission denied. What should be checked first?