guysoft / CustomPiOS

A Raspberry Pi and other ARM devices distribution builder
GNU General Public License v3.0
508 stars 146 forks source link

allow one to alter the user(name) without setting a default password #207

Closed umlaeute closed 1 year ago

umlaeute commented 1 year ago

I'd like to ship my images with a different username than the default pi, which I can do with setting BASE_USER=foo.

however, at the same time I would also like to be able to not set a default user password (so the user has to either go through the piwiz, or set the password when flashing the image with pi-imager.

However, it seems that if i set the BASE_USER_PASSWORD to an empty value, the base module will set a default password raspberry: https://github.com/guysoft/CustomPiOS/blob/8a3a002570c46409372349853622f0619baefc87/src/modules/base/config#L39

(note: i haven't done any real checks yet, whether this default password might trigger the RPi's check for default passwords and thus fire up the piwiz and disable ssh all the same; but in order to not forget about this, i report it here)

guysoft commented 1 year ago

I don't think you can because the rpi image ships with a password. I guess a workaround is you could remove the password using

passwd --delete username
guysoft commented 1 year ago

BTW, care to share what image you are building? Could be added to: https://github.com/guysoft/CustomPiOS#list-of-distributions-using-custompios

umlaeute commented 1 year ago

i see. i found that using BASE_ADD_USER="no" does what i want (well mostly; with older rpi-imager this means that i cannot preseed a username, and instead it will always be pi, but i guess I have to live with that).