Fixing means closing what is not needed, updating what is old and tightening the login, in that order of thought: fewer doors, stronger locks. Each fix does one job and none of them does all of them, so you layer them and then check again.
You have a list of findings. In what order, and how, do you fix them?
What you should already know:
Host Jellyfin, a media server· Jellyfin serves your films and music to any device on the network, through a web page on port 8096.
Now you are the administrator. For each finding there is a fix: stop what is not needed, upgrade what is old, change the ssh settings, and filter the rest with the firewall. This lesson starts on the target itself, as admin. The commands are the same ones used on any Linux server: systemctl, apt, tee and ufw.
How this lesson works: Predict, Try, Investigate, Modify, Practise, Make
Predict: Read the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Try: Try it on the board and compare the result with your prediction.
Investigate: Work out why it happens, one step at a time.
Modify: Change the problem on purpose and see what happens.
Practise: A few on your own, to check you have it.
Make: Make your own problem using what you have learned. Expect a few tries; that is normal.
Make your prediction first. Help opens once you've locked it in.
PredictRead the problem and decide what you think before you try anything. A wrong guess is fine: it shows you what to look for.
Stop the service
TryTry it on the board and compare the result with your prediction.
Try: close two doors
Was your prediction right?
Try it yourselfYour edits are saved in this browser.
Stop the two services that are findings at any version: telnet and vsftpd. Use sudo systemctl stop.
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: Four fixes, four jobs
Worked exampleBefore each step, say what you think comes next.
sudo systemctl stop telnetclose the door (add disable to keep it off).
sudo apt update; sudo apt upgradefetch and install the fixed versions.
\text{echo -e "PermitRootLogin no\\nPasswordAuthentication no" | sudo tee /etc/ssh/sshd_config}tighten ssh.
sudo systemctl restart sshssh reads its settings only when it starts.
Now try it yourself.
Sam fixes Apache. Click the line where it first goes wrong.
ModifyChange the problem on purpose and see what happens.
Vary: change one thing
Try it yourselfYour edits are saved in this browser.
Upgrade the old software: update the lists, then upgrade.
Use the board. This ticks when you get there.
Turn off password login and root login for ssh, and make ssh read the new settings.
Use the board. This ticks when you get there.
Use the firewall so only ssh (22) and web (80) can be reached: allow 22, allow 80, then enable.
Use the board. This ticks when you get there.
PractiseA few on your own, to check you have it.
Practise
MakeMake your own problem using what you have learned. Expect a few tries; that is normal.
Harden it
Then: a fix is not proved until you scan again. That is the challenge.
Try it yourselfYour edits are saved in this browser.
Fixing means closing what is not needed, updating what is old and tightening the login, in that order of thought: fewer doors, stronger locks. Each fix does one job and none of them does all of them, so you layer them and then check again. About 40 minutes.
I can close a service, upgrade old software and tighten ssh.
I can say what each fix does and does not protect.
I can say why a service must restart for config changes.
Before class
Try the boards yourselves.
The gate (read first). This course teaches security as audit and defence: you scan, read and fix a lab computer your class owns. The pretend Kali and target in the lessons are safe anywhere. The real-lab version is different, so it needs your sign-off before anyone starts: school policy and IT's agreement, a written lab agreement every student signs (lab-rules.txt on the board is a model), and a lab that is cut off from every other network: a Pi running Kali and a second Pi or a virtual machine as the target, joined by one switch or one ethernet cable, with no router and no internet. Download the Kali image and any tools once, at home or at IT's request. Scan only the target named on the lab sheet. This course does not teach breaking into anything: it stops at find, understand and fix. It relaxes the 'defensive only' rule of the other courses only in that the real lab uses real scanning tools on a computer the class owns.
Simplifications: key login is described but not set up on the board (a real lab would also create a key pair with ssh-keygen and copy it with ssh-copy-id before turning passwords off, or you lock yourself out: test in a second session first). The pretend firewall tracks allow <port> and enable only. apt reads a pretend local mirror (a real offline lab uses a mirror such as apt-cacher-ng or a USB bundle of .deb files). Make sure students know the lockout risk from System admin: allow ssh before enabling the firewall.
Real lab, if you run one: Kali Linux has a Raspberry Pi image (Pi 4 or Pi 5; the Pi 5 wants its 27 W supply); flash it with Raspberry Pi Imager or the Kali image instructions and boot it with a screen and keyboard, or ssh in. The target can be a second Pi (an older Raspberry Pi OS with a few extra services) or a purpose-made practice target your IT team approves. Start from the same state every time: re-flash, or snapshot a virtual machine. nmap is already on Kali. Give each pair a printed lab sheet naming the target's address, the one account they may use and what they are allowed to change.
Other options: ufw is the friendly firewall (nftables is what is underneath); unattended-upgrades installs security updates automatically; fail2ban blocks repeated failures.
Running the lesson
Predict: wrong answers think a service can be closed in the firewall alone.
Try: ask which door is now closed.
Worked example: stop at Sam and ask what the firewall protects.
Vary: ask which fix covers which finding.
Make: ask what is left that you did not fix.
The hard part (on purpose)
Treating one fix as enough. Each fix does one job; the layering is the point.
When students get stuck
The ssh settings do not seem to apply. Ask: Did you restart ssh? Fix: sudo systemctl restart ssh.
A student's config file lost lines. Ask: Did you use tee without -a? Fix: tee replaces the file: write all the lines you want.
Stretch and support
Stretch: Find out how key login works and what must be done before password login is switched off.
Support: A card pairing each finding with its fix.
Where it leads
Links: System admin on a Raspberry Pi (services, ufw, users); next: the audit report.
What each step is for
stop the service: Committing to what stopping a service changes tests the new move: no service, no door.
Try: close two doors: Stopping the risky services settles the prediction.
Worked example: Four fixes, four jobs: 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 fix: upgrade, tighten the login, filter with the firewall.
Practise: Choosing fixes and knowing what they do not do is the same move in new forms, plus a review of logs.
harden it: Applying every layer, and leaving nothing behind, is the whole move.