Re: Yocto build to add root password


Thanks Gabriele, Rudolf and Mauro, brilliant.

On 11/26/19, Mauro <m.salvini@...> wrote:
On 25/11/19 17:24, Rudolf J Streif wrote:

That's done via the extrausers class in an image recipe. Add this to
your image recipe:

inherit extrausers

ROOT_PASSWORD = "secret"

EXTRA_USERS_PARAMS = "usermod -p `openssl passwd ${ROOT_PASSWORD}` root;"


Make sure you use the backticks (`).


On 11/23/19 2:25 PM, JH wrote:


I built a Yocto image and I could log into the root without password,
how could I set up the Yocto build in a receipt to set password for

Thank you.

Kind regards,

- jh

pay attention that "openssl passwd ${ROOT_PASSWORD}" command handles
only passwords up to 8 characters (the extra characters will be
truncated and the generated hash is for the first eight).

If you want to use more than 8 characters in the password, use another
password algorithm instead of the default one. You can see other
supported algorithms typing "openssl help passwd".

For example, command could become

openssl passwd -6 ${ROOT_PASSWORD}


Mauro Salvini | KOAN sas | Bergamo - Italia
embedded software engineering
Phone: +39 035-255235

Join { to automatically receive all group messages.