A Raspberry Pi can run with no screen. From your laptop you reach it by name or address and type to it with ssh. Every command after ssh runs on the Pi, until you type exit.
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 log in to the Pi from my laptop with ssh.
I can say where a command runs: on the laptop, or on the Pi.
I can explain why a name is steadier than an address.
Timing
Predict and Try 8 min · Worked example 10 min · Vary 10 min · Practise and Make 12 min
Before class
Try the boards yourself.
The one idea: ssh joins your keyboard to another computer, so commands run there. Names and addresses find a computer (Networks › Across the internet); an account says who may use it (Security and privacy).
Simplifications: the pretend laptop knows one Pi, raspberrypi.local or 192.168.1.23, and its password is always accepted. A real Pi asks for the password you set.
Real Pi (optional, any time): the pretend Pi is the same for every student, so nothing here needs hardware. If you have Pis, any number per group works, Pi 4 or Pi 5. A Pi 5 needs a 27 W USB-C supply (a 15 W phone charger makes it complain and limit USB power). Students can sit at a Pi with a screen and keyboard, or reach it by ssh from a laptop once it is on the network. Either start works for every lesson after the first: choose a ready-made image (you set the hostname, the user and ssh once, then clone the card) or have students flash their own with Raspberry Pi Imager (OS: Raspberry Pi OS Lite 64-bit; in the settings set a hostname, a user and password, ssh on, and Wi-Fi if needed). Both reach lesson 2 in the same state. To start again: reflash the card, or write a short reset script (remove added users, sudo apt remove, restore saved config files) and run it.
Other options: this lesson uses ssh, which is on Mac, Linux and recent Windows. On older Windows, PuTTY does the same job. A Pi with a screen and keyboard needs no ssh at all; the next lessons are identical.
Running the lesson
Predict: the wrong answers think the laptop does the work.
Try: ask whose prompt it is.
Worked example: point out how little changes on screen, but everything changes where it runs.
Vary: ask why a wrong user is refused even though the Pi is reachable.
Make: ask what an administrator checks first when a server seems slow.
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) You can't touch the computer. How do you control it?
What do you need to find it?
What proves you are allowed?
A name or address, then an account and password.
Two prompts(predict, 4 min)
Write the laptop prompt and the Pi prompt on cards. Hold up the one where the next command runs.
The prompt tells you.
Refused(investigate) ssh says Connection refused. The Pi is on. What is the likeliest cause? ssh is not running on the Pi Refused means nothing is listening on port 22.
The hard part (on purpose)
Students forget which computer they are typing on. Read the prompt aloud every time: sam@laptop or pi@raspberrypi.
When students get stuck
What you will see
A question to ask
The fix
A student runs commands and nothing seems to change.
Whose prompt is it? Have you logged in?
ssh pi@raspberrypi.local first.
A student types exit and thinks the Pi has shut down.
What did exit end?
Only the session. The Pi keeps running.
Answers to the checks
where does it run?: On your laptop you type ssh pi@raspberrypi.local and log in. Where does the next command you type run? On the Pi. Until you type exit, everything you type is sent to the Pi and run there. Only the text comes back.
Try: reach the Pi: Log in with ssh pi@raspberrypi.local. Look at the prompt: whose name is in it now?
The prompt says pi@raspberrypi. You are typing on your laptop, but the commands run on the Pi.
Logging in, step by step: The Pi is reachable as raspberrypi.local and as 192.168.1.23. After the router restarts, which is more likely to still work? raspberrypi.local: the name follows the Pi The name goes with the Pi. The router may give it a new address, so use the name first and the address as a backup.
Find the mistake: Sam checks the Pi's disk space. Click the line where it first goes wrong. line 2 Line 2: without ssh, df -h shows the laptop's disk. Log in with ssh first, then the command runs on the Pi.
Connection refused: ssh pi@raspberrypi.local says: Connection refused. What does it most likely mean? Nothing on the Pi is listening for ssh Refused means the Pi is on the network and answered, but no program is waiting on port 22 (the ssh service is stopped). Services come in lesson 4.
Ask its name: Log in, then run hostname to ask the Pi its name.
ssh pi@raspberrypi.local, then hostname prints raspberrypi.
Can it reach the laptop?: You are on the Pi. Check that it can reach your laptop at 192.168.1.20 with ping.
ping 192.168.1.20: replies mean the two computers can talk.
No account: Try ssh sam@raspberrypi.local. The Pi has no user sam. What happens?
Permission denied: you need an account on the Pi. Names and addresses find a computer; accounts decide who may use it.
Address check: Which of these cannot be an IP address? 192.168.1.300 Each number is 0 to 255, so 300 is too big.
Leaving: You are logged in to the Pi over ssh. You type exit. Where are you? Back at your laptop's prompt exit closes the ssh session. The Pi keeps running.
Review: permissions: Review: a file is rw------- (600). Can another user read it? No: others have no permissions The last three characters are ---: nothing for everyone else.
check in on the Pi: From your laptop, log in to the Pi and run uptime to see how long it has been on.
uptime tells you how long the Pi has been on. Administrators check it first when something seems wrong.
Solutions
One possible solution for each task. Other correct programs are fine.
Vary: change one thing › Ask its name
Open task: any program that does what the step asks.
Vary: change one thing › Can it reach the laptop?
Open task: any program that does what the step asks.
Vary: change one thing › No account
Open task: any program that does what the step asks.
check in on the Pi
Open task: any program that does what the step asks.
Stretch and support
Stretch: Find out what ssh keys are and why many servers do not allow passwords at all.
Support: Write the two prompts on the board: sam@laptop and pi@raspberrypi.
Exit ticket
Where does a command run after you ssh to the Pi, and how do you get back?
On the Pi. Type exit to return to your laptop.
What each step is for
where does it run?: Committing to where the next commands run tests the new move: ssh joins your keyboard to another computer.
Try: reach the Pi: Logging in and watching the prompt settles the prediction.
Worked example: Logging in, step by step: Following the method once, then finding where a plausible account goes wrong, models the new move.
Vary: change one thing: Each task changes one thing: ask the Pi its name, check the laptop can reach it, then log in as someone who has no account.
Practise: Reading addresses and ssh messages without the board is the same move in new forms, plus a review of permissions.
check in on the Pi: Putting the steps together on your own is the whole move: reach the Pi, then use it.
Where it leads
Links: Networks › Across the internet (names and addresses); Security and privacy › Names and addresses; next: Install software.