News for hackers. Stuff that matters.
Re:Raspberry Pi update removes the default user by ajsnigrutin on Thursday April 07, 2022 @06:07PM (#30950907)
Wtf? So how do I install this headlessly, without needing a separate piece of software (imager?)?

I used to just dd the image, touch the 'ssh' file on the boot partition, and then change stuff over ssh.

Re:Raspberry Pi update removes the default user by shakna on Thursday April 07, 2022 @06:12PM (#30950950)
> There are also mechanisms to preconfigure an image without using Imager. To set up a user on first boot and bypass the wizard completely, create a file called userconf or userconf.txt in the boot partition of the SD card; this is the part of the SD card which can be seen when it is mounted in a Windows or MacOS computer.

> This file should contain a single line of text, consisting of username:encrypted- password – so your desired username, followed immediately by a colon, followed immediately by an encrypted representation of the password you want to use.

> To generate the encrypted password, the easiest way is to use OpenSSL on a Raspberry Pi that is already running – open a terminal window and enter

     echo 'mypassword' | openssl passwd -6 -stdin
> This will produce what looks like a string of random characters, which is actually an encrypted version of the supplied password.

From the anouncement [0], under "Headless setup".

[0] https://www.raspberrypi.com/news/raspberry-pi-bullseye-updat...

Re:Raspberry Pi update removes the default user by tzs on Thursday April 07, 2022 @09:41PM (#30952399)
That's great. It would be even greater if userconf.txt could also contain an ssh key after the first line and put that ssh key on the new user.
Re:Raspberry Pi update removes the default user by tssva on Thursday April 07, 2022 @10:43PM (#30952781)
If you enable ssh or configure wifi settings using the Raspberry Pi Imager it creates the shell script firstrun.sh on the fat partition. This script is launched using the systemd.run option set in cmdline.txt. This script will enable the ssh service, copy over wifi settings to the ext4 partition, change cmdline.txt so it is no longer run and then reboot the pi. You could take this script and extend it to do anything you would like including copying over ssh keys.
Re:Raspberry Pi update removes the default user by oauea on Thursday April 07, 2022 @06:26PM (#30951081)
hashed*
Re:Raspberry Pi update removes the default user by shakna on Friday April 08, 2022 @12:20AM (#30953307)
All I did was quote the article. If you want to be a pedant, you need to take it up with the Raspberry Pi Foundation. I don't think a one-word answer here on HN, is going to do a thing.
Re:Raspberry Pi update removes the default user by oauea on Friday April 08, 2022 @08:40AM (#30956136)
Differentiating between hashing and encryption is not pedantic. But sure, go ahead and keep telling newbies to encrypt their passwords.
Re:Raspberry Pi update removes the default user by shakna on Friday April 08, 2022 @08:55AM (#30956260)
Perhaps. But supplying a one-word correction which requires you to already understand the context fully to be able to interpret it, is difficult to see as anything but pointless pedantry, despite trying.

The only people to understand the comment, are the ones it won't help.

Re:Raspberry Pi update removes the default user by qbasic_forever on Thursday April 07, 2022 @06:57PM (#30951309)
If you're running a headless setup I'd switch to Ubuntu. You can use cloud-init and set it all up just like a VPS.
Re:Raspberry Pi update removes the default user by dividedbyzero on Friday April 08, 2022 @05:11AM (#30954892)
Do sound, gpio and the onboard camera and display ports work out of the box?
Re:Raspberry Pi update removes the default user by jturpin on Friday April 08, 2022 @12:34AM (#30953356)
This is what I do to bootstrap my Raspberry Pi's and its great.
Re:Raspberry Pi update removes the default user by usr1106 on Thursday April 07, 2022 @08:42PM (#30952051)
There is a documented way to create a first user.

For all other kind of early sys admin tasks for a headless system you can mount the image to your Linux workstation and chroot into it using binfmt_misc and qemu-static. https://wiki.debian.org/RaspberryPi/qemu-user-static seems to describe it. (I haven't used those instructions, but my own 10 year old cheatsheet.)

Re:Raspberry Pi update removes the default user by unfocussed_mike on Friday April 08, 2022 @08:16AM (#30955964)
FWIW, recent versions of the Imager have a hidden control panel where you can set the username and password and enable ssh etc.

https://9to5linux.com/raspberry-pi-imager-now-lets-you-contr...

Re:Raspberry Pi update removes the default user by rlpb on Thursday April 07, 2022 @06:15PM (#30950976)
They've provided a mechanism to do that. Similar to the SSH mechanism you already know about.
Re:Raspberry Pi update removes the default user by simongr3dal on Thursday April 07, 2022 @06:10PM (#30950937)
Maybe you can pipe a username and password, or maybe an ssh publickey, into the ssh file and it will create that user?

I wouldn’t be too worried, there will likely be a solution for “power users” who use the ssh file.

Re:Raspberry Pi update removes the default user by _joel on Thursday April 07, 2022 @06:10PM (#30950932)
loopback mount and chroot into the fs, passwd. I'm sure there are probably easier ways though
Re:Raspberry Pi update removes the default user by ajsnigrutin on Thursday April 07, 2022 @06:15PM (#30950978)
I'm not sure that the arm binary "passwd" will run on x86/_64
Re:Raspberry Pi update removes the default user by qbasic_forever on Thursday April 07, 2022 @06:59PM (#30951335)
QEMU and binfmt_misc should do the trick: https://wiki.debian.org/QemuUserEmulation
Re:Raspberry Pi update removes the default user by _joel on Thursday April 07, 2022 @06:24PM (#30951063)
Ahh yes, there's qemu-arch64 but that's probably another rabbithole :)
Re:Raspberry Pi update removes the default user by usr1106 on Thursday April 07, 2022 @08:53PM (#30952108)
I have used qemu-static a lot to work with ARM images and it works surprisingly well. That was before arm64 was a thing, but unless someone tells me the opposite I would not assume it makes a difference. The only thing that I remember not working is strace(1) because ptrace(2) is unimplemented. But even for that there is a special qemu option to get something similar.
Re:Raspberry Pi update removes the default user by exfascist on Thursday April 07, 2022 @06:58PM (#30951331)
What I've done for this in the past is create buildroot images that grabbed all the dynamic data from the first FAT partition (you can get it with blkid although on the Pi you can probably just hard code it.)