Linux: Correct a File's Owner and Group
Identify a root-owned app configuration and hand that one file back to its service account. Work through it yourself in the live host terminal below.
Symptom
Identify a root-owned app configuration and hand that one file back to its service account.
Your mission
Inspect, recover, then verify
Format
Linux shell
Investigate before you configure.
Use the CLI evidence to isolate the fault, make the smallest safe correction, then verify the network state changed.
Observe the symptom and link state.
Diagnose by comparing the protocol evidence.
Verify the expected device state and confirm the original symptom is resolved.
Console access: Linux
This workspace stacks for portrait phones. Rotate to landscape for the full split-screen console.
Need a hint?
Reveal the root cause when you're ready.
Try the investigation first, then use this as your escape hatch, not a dead end.
Create a free account to open Linux: Correct a File's Owner and Group. You get the root cause and the full step-by-step fix.
No spam. The fix lands in your inbox too. Your account includes 5 guided labs free. After that, the Learning Pass unlocks every remaining lab.
Lab debrief
Turn the session into a repeatable troubleshooting pattern.
Use this reference after your attempt: first explain the symptom, then verify the evidence, then confirm the repair.
The problem
A deployment copied app.conf as root:root. Its 640 mode leaves the webapp service account unable to read or update it during startup.
What you'll practice
- Inspect file owner and group
- Confirm the intended service identity
- Change only the affected file with chown
- Verify owner and group after the change
The topology
One Linux host runs webapp under a dedicated webapp user and group.
Commands to run yourself
The real diagnostic commands for this lab, copy-paste ready. Run these in the same order to reproduce the investigation on your own session.
ls -l /srv/webapp/config/app.confid webappTopology diagram
Rate this lab
No ratings yet
Fact-checked references
The commands and behaviour in this lab were checked against these primary references.
Frequently asked
Why avoid chown -R here?
Only one file has the wrong owner. Recursive changes could affect files with intentionally different ownership.
Does chown change the file's mode?
It can clear setuid or setgid bits on some systems. Inspect the mode after changing ownership if those bits matter.
Ready to run this lab yourself?
No setup, no image sourcing. Book a session or ask for a live demo.