Skip to content

2026/01/08 - Enabling SSH without a monitor

The raspberry pi does not have SSH enabled by default and I don't have an adapter to plug the machine into a monitor to see the CLI.

ChatGPT is telling me that all I need to do is add an empty file called "ssh" to thebootfs partition.

So I've done that, let's see.

Huh, it actually worked. The SSH goes through now instead of being refused, but there is no user set up.

Back onto the laptop https://www.raspberrypi.com/news/raspberry-pi-bullseye-update-april-2022

Okay so it turns out there is an official imaging software I can use for a headless setup to create the user before installing the OS.

After reflashing the SD card with the new Pi OS, it got a new SSH key, giving me this output:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@    WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED!     @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!
Someone could be eavesdropping on you right now (man-in-the-middle attack)!
It is also possible that a host key has just been changed.
The fingerprint for the ED25519 key sent by the remote host is
SHA256:PntWmdpTff9TNLRNuVRaHFdSAc8uyA5eH2KPZikkzmo.
Please contact your system administrator.
Add correct host key in /home/rory/.ssh/known_hosts to get rid of this message.
Offending ED25519 key in /home/rory/.ssh/known_hosts:21
Host key for 192.168.0.240 has changed and you have requested strict checking.
Host key verification failed.

That's funny.

ssh-keygen -R 192.168.0.240

And we're in.