Linux identities and permissions
Separate identities before granting access
A Linux process acts with credentials such as user and group IDs. A dedicated service account lets the bookstore catalog read stock records without sharing an administrator identity. A service account is not inherently restricted: review its group memberships, delegated sudo privileges and access to files. Prefer a named administrator identity with narrowly approved elevation for maintenance; a background service should not need general administrative rights.
Read a file mode
In an ordinary mode-bit listing, -rw-r----- means a regular file with owner read/write, group read, and no permissions for others. Octal 640 represents those three classes: read = 4, write = 2, execute = 1. For a regular file, execute permits execution subject to other conditions. For a directory, execute means search/traversal, read permits listing names, and write together with search normally permits changing directory entries. A file can be readable in its own mode but unreachable through a parent directory.
Worked example: stock export
Synthetic record: -rw-r----- stocksvc inventory stock.csv. Mina is in inventory, Arman is not, and stocksvc owns the file. Assume searchable parents, no ACLs, extra capabilities or mandatory policies. Mina can read but cannot edit the contents; Arman cannot read; stocksvc can read and write. An owner is checked using owner bits rather than choosing the most permissive class. Deletion or renaming depends on directory permissions and other constraints, not just file write permission.
Beyond mode bits
An ACL (access control list) can grant access to specific additional users or groups, subject to its mask where applicable. Linux capabilities split many privileged operations into narrower rights; even a narrow capability may be powerful. sudo policy controls delegated execution, not file ownership. A complete review includes service identity, parent paths, ACLs, capability sets and mandatory access controls. Never make a protected tree world-writable to solve an access error.
Practice: justify the smallest change
A catalog process needs only to read a price list, but a synthetic record shows it owns the file and can write it. Propose separate ownership by the publisher and read access for the service through an approved group. Check that the catalog can read, cannot edit, and unrelated accounts cannot read. Document any missing evidence, especially directory permissions. No real files or identities are used.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Linux identities and permissions — knowledge check
Reason about synthetic Linux security evidence.
Under the stated 640 example, what can Mina do?
A file has mode 644 but its parent directory denies search. What follows?
Which identity is appropriate for the catalog service?
What does a conventional directory write plus search permission normally allow?
Mode bits appear to permit access. What else can restrict it?