← Teacher guide

Challenge: the class server

Set up the Pi as the class server: a hand-in share, accounts in one group, a firewall that lets only the right ports through, and a nightly backup. Then explain what each part protects, and what it does not.

System admin on a Raspberry Pi · The class server · about 40 minutes · Open the student lesson

Classroom resources

Open these in Waypoints Prepare with one click. To share a file another way, copy its address and paste it into Load URL, or download the file and import it. In Prepare, the worksheet's Teacher edition shows the answers; the student copy hides them.

Students will be able to

Timing

Predict and Try 8 min · Worked example 10 min · Vary 10 min · Practise and Make 12 min

Before class

Try the board yourself; it is the longest Make in the course.

The one idea: several components together secure a networked system, and each covers a different risk. Students should leave able to say, for each layer, what it does not protect: the firewall does not stop a stolen password; permissions do not stop a failed disk; a backup does not stop a leak.

Simplifications: the pretend firewall tracks allow <port> and enable, not source addresses or default policies. The real ufw lets you restrict by network (for example only 192.168.1.0/24) which is what a school would do.

This is the capstone for System admin. Students then complete the brief (an admin log and a short report), which assesses AC9TDI10K01 nodes 3 and 5. If you have a real Pi, setting up the same server on it is a good practical.

A later extension, a lab with Kali Linux on a Pi in an offline network, is planned (roadmap/systems.md); it needs your sign-off and a lab network the school IT team approves.

With internet: automatic updates, off-site backups and a VPN (Tailscale or WireGuard) belong on a server people use from home. A domain name and certificate (Let's Encrypt) matter when a service is public, and so does an honest answer to 'should it be public at all?'

Running the lesson

  1. Predict: wrong answers think the rule can come second.
  2. Try: ask what would have happened in the other order.
  3. Worked example: ask which layer would have stopped each of the 'what if' stories.
  4. Vary: have pairs check each other's work.
  5. Make: ask each pair which layer they would add next.

In class

On the slides at these points. Students can do the whole lesson on their own; these are for the room. In the deck, the Run, Modify and Make slides have the live playground in them (the tutorial link is the backup), and the notes above are in each slide's speaker notes.

The hard part (on purpose)

The order of the firewall steps and remembering every layer. Give students a checklist and tick it as they go.

When students get stuck

What you will seeA question to askThe fix
The share works but nobody can save.Who owns the folder, and which group?chgrp class and chmod 775.
A student gets locked out of ssh.Did you allow ssh before enabling?Restart the board: this is the lesson. On a real Pi it needs a keyboard.

Answers to the checks

  1. firewall order: You are logged in to the Pi over ssh. You type sudo ufw enable first, planning to add the ssh rule next. What happens?
    Your session drops, and nobody can log in again over the network. Allow ssh first, then enable the firewall.
  2. Try: the safe order: Log in with ssh pi@raspberrypi.local, allow ssh with sudo ufw allow ssh, and only then enable the firewall: sudo ufw enable.

    Allow first, enable second. Now you are protected and still logged in.
  3. Layers, not one lock: Which part protects against 'a file is deleted by mistake'?
    A backup
    Each layer covers one risk. The backup is the one that covers loss.
  4. Find the mistake: Sam is locked out. Click the line where it first goes wrong.
    line 2
    Line 2: with the firewall on and no ssh rule, the connection drops. Allow ssh first, then enable.
  5. Reaching it from home: Which is safer for watching Jellyfin away from school: opening port 8096 on the router, or a VPN such as Tailscale or WireGuard?
    A VPN: only devices you trust can reach it
    An open port faces the whole internet. A VPN keeps the server on a private network that only your devices join.
  6. The software: Install samba and jellyfin.

    sudo apt install samba jellyfin (the lists are up to date).
  7. The doors: Turn the firewall on so that only Jellyfin's port 8096 gets through (and ssh).

    sudo ufw allow ssh, sudo ufw allow 8096, sudo ufw enable.
  8. After a reboot: smbd runs but is not enabled. Make it survive a reboot, reboot, and check it is up.

    enable it, then sudo reboot, then check with systemctl status smbd.
  9. Two layers: Which two layers together mean 'only class members may save files, and only from the school network'?
    Group permissions and a firewall rule
    Group permissions on the folder decide who may write; the firewall decides who can reach the door.
  10. Weakest: Which is the weakest protection for a share?
    Hiding the folder's name
    Hiding is not protection (The command line › Who can read what).
  11. Reaching it from home: A student asks to open a router port so they can reach the Pi from home. What is the best first answer?
    Use a VPN instead of opening a port
    Exposing a server raises the stakes. A VPN gives the same convenience and keeps the Pi off the open internet.
  12. the class server: Set up the class server: Samba installed with a [class] share of /srv/class that Alex and Bob (group class) can write to, the firewall on with port 445 reachable, and a backup scheduled at 02:30 every night.

    Software, share, group, firewall and backup: five layers, each doing one job. Then check each by testing.

Solutions

One possible solution for each task. Other correct programs are fine.

Vary: change one thing › The software

Open task: any program that does what the step asks.

Vary: change one thing › The doors

Open task: any program that does what the step asks.

Vary: change one thing › After a reboot

Open task: any program that does what the step asks.

the class server

Open task: any program that does what the step asks.

Stretch and support

Stretch: Add automatic security updates (unattended-upgrades) and say which risk they cover.

Support: A checklist of the five layers.

Exit ticket

Name two layers of the class server and one thing each does not protect against.

Any two, for example: firewall (does not stop a stolen password), backup (does not stop a leak).

What each step is for

Where it leads

Links: Networks (ports); Cyber safety and privacy; Security and privacy; The command line.