PATCH//NOTES Open it in the app
← All hands-on practice
Linux · 15 min

Who can read this file? Linux permissions

Everyone's pay is in a file anyone on the server can read. Work out who can see what, then fix it.

Start it: free, in your browser, no account

What you will do

  1. See the permissions: run ls -l in /srv/payroll.
  2. salaries.csv is -rw-r--r--, so dave the intern can read everyone's pay. Fix it: finance can read it, only alice can change it, nobody else gets anything.
  3. Lock the payroll folder: people outside finance can't list it or go into it, but finance still can.
  4. backup.sh has no x bit, so it can't run. Make it runnable by carol only, and unreadable by everyone else.
  5. Try a trap: set salaries.csv to 460 (r-- rw- ---). Who can change it now?
  6. Finally: bob takes over payroll. Set salaries.csv back to 640 and make bob its owner (group still finance).

Exam objectives it practises

  • CompTIA A+ Core 2 1.9 Linux client tools
  • CompTIA A+ Core 2 2.7 Workstation hardening
  • CompTIA Security+ 2.5 Mitigation techniques
  • CompTIA Security+ 4.1 Security techniques for computing resources
  • CompTIA Security+ 4.6 Identity and access management
  • CompTIA PenTest+ 4.4 Host-based attacks

Simplified: one server, a few files and four people. Access is worked out the way the Linux kernel does it (one class applies: owner, else group, else others; root skips read and write checks; you need x on every folder in the path), but ACLs, setuid, setgid and sticky bits, umask and SELinux or AppArmor aren't modelled. ls -l output follows GNU coreutils. The people and the company are fictional.