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.
The Pi has no screen on it. How do you control it from across the room?
What you should already know:
Pipes· A pipe sends one command's output into the next so small commands combine.
Changing files· mkdir makes a folder, cp copies, mv moves or renames, rm deletes and echo … > saves text into a file.
A server is a computer you run from somewhere else. Almost every server, and every Pi without a screen, is run by typing to it over the network. This is the same idea as Across the internet in Networks: names and addresses find the computer, then messages go to it.
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.
Where does it run?
TryTry it on the board and compare the result with your prediction.
Try: reach the Pi
Was your prediction right?
Try it yourselfYour edits are saved in this browser.
Log in with ssh pi@raspberrypi.local. Look at the prompt: whose name is in it now?
Use the board. This ticks when you get there.
InvestigateWork out why it happens, one step at a time.
Worked example: Logging in, step by step
Worked exampleBefore each step, say what you think comes next.
ssh pi@raspberrypi.localuser pi, computer raspberrypi.local. ssh is the program that joins you to it.
passwordthe Pi checks who you are (authentication). Nothing shows as you type it.
pi@raspberrypi:$the prompt is now the Pi's. Every command runs there.
exitends the session and brings you back to the laptop.
Now try it yourself.
Sam checks the Pi's disk space. 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.
Log in, then run hostname to ask the Pi its name.
Use the board. This ticks when you get there.
You are on the Pi. Check that it can reach your laptop at 192.168.1.20 with ping.
Use the board. This ticks when you get there.
Try ssh sam@raspberrypi.local. The Pi has no user sam. What happens?
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.
Check in on the Pi
Then: on a real Pi (or any Mac or Linux computer) try hostname and uptime.
Try it yourselfYour edits are saved in this browser.
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. About 40 minutes.
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.
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.
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
A student runs commands and nothing seems to change. Ask: Whose prompt is it? Have you logged in? Fix: ssh pi@raspberrypi.local first.
A student types exit and thinks the Pi has shut down. Ask: What did exit end? Fix: Only the session. The Pi keeps running.
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.
Where it leads
Links: Networks › Across the internet (names and addresses); Security and privacy › Names and addresses; next: Install software.
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.