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?

  • As per the answer if you can access the ext4 partition this is simple, otherwise...
    – goldilocks
    Apr 19, 2021 at 15:55

1 Answer 1


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:

  1. SDM - https://github.com/gitbls/sdm
  2. Pi Boot Script - https://gitlab.com/JimDanner/pi-boot-script
  • 1
    Thanks. I have used the hidden ctrl-shift-x menu on rpi-imager for now (which does work on Linux) and will look into these other tools, which look great. Are there any advantages for either, or are they essentially the same?
    – paradroid
    Apr 19, 2021 at 18:54
  • 1
    For your needs I would look at SDM first as you have info you want to apply. Pi boot is more for scripting first boot tasks (e.g. updates / installs etc).
    – user130616
    Apr 19, 2021 at 20:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.