For headless initial configuration, it is possible to add WiFi login details by adding a
wpa_supplicant.conf file to the image boot partition.
Is it possible to add SSH public keys in a similar way? What about any other initial configuration?
Raspberry Pi Stack Exchange is a question and answer site for users and developers of hardware and software for Raspberry Pi. It only takes a minute to sign up.Sign up to join this community
There are a few tools that can change the original image but in a lot of cases you can just mount the SD card and update the files as needed from any computer that is able to read / write the Ext4 formatted partition on the card.
The other option would be to create a master SD card with everything set-up and copy that.
The new Pi imager is supposed to let you set the hostname and keys as it writes the image but I've not tried it (and it may be a PC function only). There is a web article here
There are two utilities (there may be more but these get support on GITHUB and the RPF forum from the creators) often used for set-ups that may do what you need: