Skip to main content
LEARN / LINUX SYSTEMS ADMINISTRATION / PHASE 02

Read the permissions.
Protect the boundary.

A service returns Permission denied. That tells you an operation failed—not which permission to loosen. Identify the account, trace the directory path, interpret effective file access, and respect mandatory controls before proposing the smallest approved change.

Phase 02 / Users & SecurityIntermediate fundamentals4 original investigationsFree · No account
PHASE 02 / USERS, PERMISSIONS & SECURITY

Every access decision has a subject, an object and a policy.

You already collected a certificate-read error in Phase 01. Now we'll determine exactly what the evidence does—and does not—tell us. Along the way you'll learn how identities, Unix mode bits, directories, access control lists, sudo and Linux security modules shape the result.

By the end, you should be able toExplain Linux account/group identities, decode octal permissions and directory traversal, identify an ACL mask failure, review safe privilege escalation and SSH key use, distinguish DAC from MAC, and justify a controlled access change with verification.
01 / FOLLOW THE EVIDENCE

The error hasn't changed. Your questions should.

The Phase 01 log stated that the Northstar application couldn't open /srv/northstar/certs/server.pem. That doesn't establish whether the culprit is the file, one of its parent directories, the service account's group memberships, an ACL or a mandatory security profile. It's possible for multiple controls to deny the same operation.

SUBJECTnorthstar-webService process identity
OPERATIONOpen for readRead TLS material
OBJECTserver.pemUnder /srv/northstar/certs
RESULTEACCESPermission denied

Collect evidence in order: verify the account the running service actually uses; resolve all path components; inspect the target's mode and ACL; review any mandatory-policy denial; only then decide what authorized access should exist. A read failure isn't proof of a particular fix.

Carry-over from Phase 01

We intentionally didn't run chmod 777 to make the problem disappear. In this phase, you'll see why doing so can expose sensitive files without resolving a blocked directory or AppArmor policy.

02 / WHO IS ASKING?

UID, GID, groups and service identities.

Linux access checks operate on credentials associated with a process, including its effective filesystem user and group identity and supplementary groups. Human names are a readable representation of numeric identifiers: a UID identifies a user, and GIDs identify groups. A process doesn't necessarily run as the person who initially logged in or launched a service.

USER / UIDWho owns the operation?

Service accounts such as northstar-web are distinct from your interactive account. UID 0 is the conventional root identity, but root privileges should not be assumed for a system service.

PRIMARY GIDThe default group identity

Each account has a primary group. Its name can differ from the account's username; file group ownership and access checks depend on the group ID.

SUPPLEMENTARY GROUPSAdditional memberships

Approved group memberships can grant access. Adding a group in an account database doesn't retroactively change credentials of every running process.

IDENTITY SOURCESNot just /etc/passwd

getent queries the configured name service sources. Local files, directory services and identity providers can all affect what a host resolves.

Useful checks include id, groups, getent passwd USER and the service's actual running identity. When modifying supplementary groups on systems using usermod, -aG appends; -G without -a can replace the user's entire supplementary group set. The correct change must be approved and may require a new session or a controlled service restart to be reflected by a process.

03 / THE THREE PERMISSION CLASSES

Translate -rwxr-x--- into access.

Basic Unix mode bits are three triplets: owner, group and others. Each permission has a value: read = 4, write = 2 and execute = 1. For example, 0750 grants the owner rwx (7), the group r-x (5), and others nothing (0). The leading zero is commonly used to signal an octal value in command examples.

r4

Read

w2

Write

x1

Execute / search

-0

Permission absent

INTERACTIVE / MODE DECODER

What do these permission bits actually allow?

Adjust the three permission classes and compare the octal value with the symbolic result. This models basic Unix mode bits, not extended ACLs.

OCTAL0640-rw-r-----
Interpret these bits as a
rwx
rwx
rwx

r = read file contents.

w = modify file contents.

x = execute as a program, where applicable.

The user identity determines which permission class applies. The owner isn't granted group/other fallback when owner bits deny a permission. POSIX ACLs and mandatory security controls can further change effective access. Setuid, setgid, sticky bits and mount options are outside this decoder.

Important nuance

Matching the file's owner doesn't mean you can fall back to its group or others bits if the owner class denies access. With extended POSIX ACLs, the displayed group-class mode bits may represent the ACL mask rather than the underlying owning-group ACL entry. Read getfacl before drawing conclusions from ls -l alone.

04 / DIRECTORY EXECUTE IS NOT FILE EXECUTE

A readable file can still be unreachable.

Reading /srv/northstar/reports/status.log requires search (x) permission on each ancestor directory and read (r) permission on the final file. Directory r is about listing names; directory x lets a process access a known child name. Directory w plus x generally permits creating or removing entries, potentially even when the file's own write bit is off, depending on other policies and sticky-directory rules.

/srv0755Search permitted
/srv/northstar0755Search permitted
/srv/northstar/reports0700 · root:rootSearch denied to audit-reader
status.log0640 · root:opsGroup read exists, but file can't be reached

Before changing a target file's bits, inspect the full path with namei -l. For a narrow authorization, a named-user directory ACL granting only search permission may be preferable to opening a private directory to all users. Review the directory's ACL mask and the real access requirement before implementing such a change.

05 / WHEN MODE BITS AREN'T THE COMPLETE STORY

Extended ACLs have effective permissions.

POSIX access control lists can grant permissions to particular named users and groups without changing the file owner. getfacl reveals the owning-user entry, any named entries, the owning-group entry, the effective rights mask and the others entry. The mask limits named-user and group-class permissions; it doesn't constrain the file owner or the others class.

SIMULATED getfacl /srv/audits/access.csvuser::rw-user:auditor:r-- #effective:---group::r-- #effective:---mask::---other::---

Although the ACL says user:auditor:r--, the mask --- removes that effective read right. Changing the mask to r-- would also affect group-class permissions: confirm the implications across every ACL entry and the owning group before authorizing a change. When extended ACLs are present, a plain chmod may alter the ACL mask, so verify the resulting effective ACL—not just the command's success message.

Default ACLs are a separate concept that may influence newly created files within a directory; they do not automatically change the access permissions of every existing file. They will become more relevant when we work with service directories, collaboration and deployment permissions.

Review the Linux getfacl manual ↗
06 / PRIVILEGE MUST BE INTENTIONAL

Use sudo without treating root as a shortcut.

Administrative troubleshooting sometimes needs access unavailable to a standard account. sudo runs an authorized command under another identity, commonly root, according to configured policy. sudo -l helps inspect what the current account may run. A privilege prompt or a successful sudo check isn't authorization to make an unrelated production change.

BETTER APPROACH

Least privilege & accountability

Identify the exact command, account, target and reason. Obtain approval and use a policy-scoped privilege. Record the intended result and a rollback/validation plan when changing a production service.

AVOID

Broad root access by default

Entering a root shell or granting all privileges merely to bypass an error can conceal the real permission boundary and increase the impact of mistakes. Do not expand sudoers rules without authorized review.

Adding a user to a powerful group is also a security change. For service accounts, verify the service's configured user and effective groups and consider whether a narrowly scoped group or ACL is the right solution rather than making the application run as root.

07 / REMOTE IDENTITY

SSH keys are credentials, not conveniences to copy around.

SSH protects remote connections and can authenticate users through a public/private key pair. The private key stays controlled by its owner and should generally be protected with a passphrase. The corresponding public key can be placed in an authorized account's ~/.ssh/authorized_keys file on the server according to approved access procedures.

CLIENT SIDEPrivate key

Protect it; don't email it, embed it in scripts, paste it into the training site or upload it as evidence.

SERVER SIDEAuthorized public key

Store only approved public keys. Validate home, .ssh and authorized_keys ownership/mode and SSH server configuration when troubleshooting.

CONNECTIONHost identity verification

Verify server host keys and unexpected fingerprint changes through a trusted process instead of blindly accepting a replacement.

On many Linux systems a private key should be accessible only to its owner (for example mode 0600), and the server's authorized keys and parent directory must not be writable by untrusted users. Effective enforcement depends on the SSH implementation and configuration, including StrictModes. For experimentation, use a disposable VM with a dedicated test account—not production SSH settings.

Review Ubuntu's OpenSSH Server guide ↗
08 / WHEN DAC PERMITS BUT ACCESS STILL FAILS

AppArmor and SELinux enforce another security boundary.

Unix mode bits and ACLs are discretionary access controls (DAC). Linux security modules can enforce mandatory access control (MAC), restricting what a service or confined process may access even when DAC would permit it. Ubuntu systems commonly use AppArmor profiles; Red Hat-derived environments commonly use SELinux labels and policy. Both can produce useful denial evidence, but the tools and policy models differ.

APPARMOR

Profile, operation, path

Use aa-status and relevant kernel/audit logs. A matching apparmor="DENIED" event can identify the confined profile, attempted operation and denied path. Profile changes belong to an authorized policy owner.

Ubuntu AppArmor documentation ↗
SELINUX

Label and AVC evidence

On SELinux systems, inspect enforcement state and the file/process contexts. Where available, use tools such as ausearch to inspect AVC records. Missing logs alone do not prove that SELinux isn't involved.

Red Hat SELinux guidance ↗
Security rule

Neither chmod 777 nor globally disabling AppArmor/SELinux is an appropriate default response to a service failure. Match the denial to the intended application behavior, review the policy with its owner, and validate a narrowly scoped authorized correction.

09 / FOUR GUIDED INVESTIGATIONS

Diagnose the access failure. Don't guess.

Each case provides four read-only evidence checks, a proposed action, a simulated authorization step and a validation checkpoint. In three cases you can model a narrow permissions correction; the mandatory-policy case ends with an escalation because its actual resolution requires a policy owner. The workbench uses no real shell, Linux server, credentials or network connection.

HANDS-ON INVESTIGATIONS / PHASE 02

Northstar Access Investigation Workbench

Four independent permission incidents. Gather account, path and policy evidence before deciding whether to apply a scoped simulated change or escalate.

0/4INVESTIGATIONS REVIEWED
INCIDENT 01 / REVIEW THE EVIDENCE

The certificate-read failure

Continue the Northstar intranet incident from Phase 01. The service is denied access to its TLS file during startup.

PROCESS / ACCOUNTnorthstar-webGroups: svc-web, tls-readers
01 / COLLECT EVIDENCE0/4 examined

Select each read-only inspection. Output is prebuilt for the scenario; these commands are examples, not executed against a computer.

Access decision / before changes
directory · /srvx required · Other mode · permits
directory · /srv/northstarx required · Other mode · permits
directory · /srv/northstar/certsx required · Owning-group mode · permits
file · /srv/northstar/certs/server.pemr required · Owning-group mode · blocks
mandatory policy · /srv/northstar/certs/server.pemallowed required · AppArmor · permits

At least one discretionary-access check blocks the request. No modeled mandatory-policy denial.

02 / JUSTIFY THE RESPONSEReview all evidence
What is the safest next step?

Inspect all four evidence sources to unlock a defensible decision. You can revisit any output without penalty.

These are explanatory simulations, not a Linux shell. DAC, ACL and mandatory-policy checks are simplified; production access depends on more context than the workbench models.

10 / INDEPENDENT UNDERSTANDING CHECK

Would you preserve the security boundary?

These decisions cover topics not solved by changing a file mode: sudo policy, supplementary group changes, SSH key handling, and AppArmor evidence. Choose an answer, read the explanation, and revise your decision if needed.

CHECK YOUR JUDGMENT / IDENTITY & REMOTE ACCESS0/4 answered · 0 correct
01 A user needs to inspect which elevated commands their approved account can run. What is the least-privilege first step?
02 An administrator needs to add someone to the existing log-readers group without removing other supplementary groups. Which option preserves existing membership?
03 Which key belongs in an SSH server account's authorized_keys file?
04 Unix mode bits would allow a read, but an audit event shows a matching AppArmor DENIED record. What's the next investigation?
11 / GET READY FOR SERVICE TROUBLESHOOTING

A passing permission check isn't the end of the incident.

By now you can evaluate a process identity, follow the directory path, distinguish base mode bits from ACL effective rights, and recognize when mandatory security policy is the real blocker. You also know why privilege escalation must follow an approved operational purpose.

01 / SUBJECTEstablish the process identity

Verify the service's actual user, group set and running credentials—not merely the account database.

02 / DISCRETIONARYWalk every path component

Check directory search and target read, then account for named ACL entries and their mask.

03 / MANDATORYCorrelate any policy denial

Inspect AppArmor or SELinux evidence before granting wider DAC access.

04 / VALIDATEProve the original workflow

After an authorized correction, test as the correct account and verify the actual service independently.

NEXT / PHASE 03 CURRICULUM

Services, Processes & Software

The next phase follows the same Northstar application into systemctl, journalctl, process state, package changes and recovery validation. It will distinguish a file that can be read from a service that actually starts and serves requests.

Continue to Phase 03 — Services, Processes & Software →
AFTER THE LESSON / PRACTICE & LAB

Use the reading sections to build your access-control model. Then investigate all four Northstar incidents and review the independent security questions before moving forward.

CONTINUE YOUR LEARNING PATH · LINUX SYSTEMS ADMINISTRATION

Continue to the next milestone

You've reached the end of this written lesson. Your next step is learn: Services, Processes & Software. Complete that milestone before moving to the following lesson. You can revisit the explanation whenever you need it. Next: milestone 3 of 5.

Your completion marks are saved in this browser only.