Yocto: Remove password of new user

Hi,

I try to add a password-less user with the following Yocto-recipe

SUMMARY = "Lorem Ipsum"
DESCRIPTION = "Lorem Ipsum"
LICENSE = "CLOSED"
PR = "r1"

inherit useradd

USERADD_PACKAGES = "${PN}"
USERADD_PARAM_${PN} = "user"
GROUPADD_PARAM_${PN} = ""

do_install () {
	passwd -d user
}

but the bitbake fails with the error “passwd: Permission denied”

I helped me with a systemd-unit that is called once on first boot and that delete the password of the user. But is there a more elegant way to solve this directly with Yocto?

Best regards

Dear @Mowlwurf ,

You can edit your EXTRA_IMAGE_FEATURES in your local.conf to achieve this. debug-tweaks can be especially be helpful for you. For more information, please refer to this yocto link here: https://www.yoctoproject.org/docs/2.0/ref-manual/ref-manual.html#ref-features-image

Best Regards,
Janani