Linux Labs

Users, permissions, and processes / Stage 3 of 13

Changing and diagnosing permissions

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 8 · lab · 15 mineasy

Wrong file permissions

The app service won't start after moving to a new server. Find where it is denied access and fix the permissions without opening anything extra.

Situation

The app service was moved to a new server, and it will not start. The service runs as the appuser account: on start it reads the config /etc/app/app.conf and the key /etc/app/secret.key, and it writes its log to the directory /var/lib/app.

sudo systemctl status app shows what happened to the service: the end of its output holds the last lines of its log (without sudo they are hidden). To restart it, run sudo systemctl restart app.

Task

Make it so that:

  1. the app service works — it starts without any access denials;
  2. appuser can read its config /etc/app/app.conf;
  3. the directory /var/lib/app belongs to appuser, and appuser can write to it;
  4. the key /etc/app/secret.key is accessible to appuser alone: owner appuser, mode 600.

The tools you need are already installed. There's no internet on this machine.

Lab · on your own

No commands are given in this lab: type them in the terminal yourself. Goals are checked on the machine after every command.

Goals

0 of 6
  • appuser can read /etc/app/app.conf — not done yet
  • /var/lib/app is owned by appuser — not done yet
  • appuser can write to /var/lib/app — not done yet
  • /etc/app/secret.key has mode 600 — not done yet
  • appuser can read secret.key — not done yet
  • The app service is active — not done yet
Ctrl+Enter
Starts the machine node1 · Ubuntu 24.04

The machine is starting

Hints

0 of 3

Lab goals

0 of 6
  • appuser can read /etc/app/app.conf — not done yet
  • /var/lib/app is owned by appuser — not done yet
  • appuser can write to /var/lib/app — not done yet
  • /etc/app/secret.key has mode 600 — not done yet
  • appuser can read secret.key — not done yet
  • The app service is active — not done yet
node1 Ubuntu 24.04

Lab goals

0 of 6
  • appuser can read /etc/app/app.conf — not done yet
  • /var/lib/app is owned by appuser — not done yet
  • appuser can write to /var/lib/app — not done yet
  • /etc/app/secret.key has mode 600 — not done yet
  • appuser can read secret.key — not done yet
  • The app service is active — not done yet
Loading…