Further notes for running current Raspi-OS headless


  • Thu 13 July 2023
  • misc

You turned on ssh by touching a file called ssh in the FAT-formatted boot partition, but you still can't log in, right?

The Raspberry Pi people decided that getting rid of pi/raspberry on first startup was important - can't fault them from a cybersecurity perspective. You have to set up a username (probably not pi) and password (hopefully not raspberry) at first run, in a setup wizard.

Well, what if you want to run headless? The documentation as of April 2022 says that you should do something like:

echo 'pi:$6$KKTv34KI7sc9vKcB$1bTfYnb0e5MpzahXpXzsWIlQ/K7TRHQFleX3eAbDFoBFWHuGyyN/Nj7I.k0MPUGxxnzjU.I.M9WVLMe1YrRB7/' > "$BOOTDIR"/userconf.txt

to put back pi/raspberry. Note the single quotes. If you use double quotes a $ in your password hash will get expanded by the shell, and what you think you're putting in userconf.txt won't be what actually goes there and you won't be able to log in.

Of course, you're highly advised to replace pi/raspberry with some other hash, created the way they tell you to in the blog.

But now you're able to log in, but you can't connect to the vnc server from your Mac, which speaks an old and crufty (with old and crufty crypto) version of the VNC protocol despite following the process I previously outlined for Buster.

Well, time hurries on and RealVNC Server is among the things upgraded in Bullseye. Current version is 7.0.1.49073.

In addition to Authentication=VncAuth, you need to add Encryption=AlwaysOff to /root/.vnc/config.d/vncserver-x11 just above the "Password" line.

By the way, if you're looking for Raspberry Pis by arp entry after brining one up new headless (and strobing your network with nmap -sP 192.0.2.0/24, you can find them by running arp -an | egrep -i '(28:CD:C1|B8:27:EB|D8:3A:DD|DC:A6:32|E4:5F:01)'