Raspbian used to have its default user "pi" with a well known password. Naturally people were expected to nuke the user and create their own or at least change the password. Unfortunately we now have approximately bazillion Raspberries with public IPs and the default password in place, so the developers finally retired the concept of default user when they went from Debian 10 to 11.
Raspbian 10's renamed successor, Raspberry Pi OS expects you to use their GUI tool to write the card images. It creates the default user among couple of other options. But under the hood it doesn't actually add users to the Linux system, it just creates couple of text files that are used to configure the freshly installed system on its first boot. This approach makes it possible to make the image writer software portable, as all the major OSes support the FAT-partition Raspberry uses to boot.
If you don't want to use the official tool, just download the image, write it onto a SD card and then mount the first partition on a temporary directory. You can create two extra files here to create your user on the first boot: an empty file called ssh (or ssh.txt) to enable SSH by default and userconf (or userconf.txt) to create a new user. The userconf file is in the format of "username:password hash" and can be generated with an oneliner such as this:
(echo -n "pi:" ; openssl passwd -6 -stdin <<< 'raspberry') > userconf
Change the name and password as wanted, in the example they are "pi" and "raspberry".
No comments:
Post a Comment