How to set root password on Yocto / Poky image?

Alessandro Da Rugna picture Alessandro Da Rugna · Aug 28, 2015 · Viewed 14k times · Source

I am building an image with Yocto/Poky release Daisy 1.6.3.
What is the correct way or config file where to set the root password? The default password is empty and I can't find a place where to specify it.

Answer

john madieu picture john madieu · Aug 28, 2015

Here is what you have to do in your recipe.

inherit extrausers
EXTRA_USERS_PARAMS = "usermod -P p@ssw0rd root;"

where p@ssw0rd is the password you want root user to have.

This link may help you.

As "debug-tweaks"'s goal is to set root's password empty, you must remove it from your EXTRA_IMAGE_FEATURES.