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.
WorksheetOpen in PrintDownload Print the student copy; the Teacher edition has the answers.
Students will be able to
I can set up a share, accounts, a firewall and a backup that work together.
I can say what each part protects against and what it does not.
I can explain why exposing a server to the internet raises the stakes.
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
Predict: wrong answers think the rule can come second.
Try: ask what would have happened in the other order.
Worked example: ask which layer would have stopped each of the 'what if' stories.
Vary: have pairs check each other's work.
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.
Think, pair, share(start) Your class gets one Pi. How do you make it safe to share?
What could go wrong?
Which part would stop each one?
Who, what, which doors, what if.
What could go wrong?(predict, 5 min)
List five things that could go wrong with a shared server. Match each to the layer that covers it.
Each layer covers one.
Order(investigate) You are on ssh. What comes first? sudo ufw allow ssh Allow first, then enable.
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 see
A question to ask
The 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
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.
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.
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.
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.
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.
The software: Install samba and jellyfin.
sudo apt install samba jellyfin (the lists are up to date).
The doors: Turn the firewall on so that only Jellyfin's port 8096 gets through (and ssh).
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.
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.
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).
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.
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
firewall order: Committing to the order of two steps tests the new move: a firewall can lock you out of the machine you are fixing.
Try: the safe order: Doing it in the safe order settles the prediction.
Worked example: Layers, not one lock: Following the method once, then finding where a plausible account goes wrong, models the new move.
Vary: change one thing: Each task is one layer of the class server: the software, the firewall and surviving a reboot.
Practise: Matching layers to risks and judging what is safe is the same move in new forms.
the class server: Putting every layer together is the whole challenge.
Where it leads
Links: Networks (ports); Cyber safety and privacy; Security and privacy; The command line.