How to set root password on Yocto / Poky image?

烂漫一生 提交于 2019-12-10 04:35:43

问题


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.


回答1:


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.




回答2:


As of Poky 2.1.2; to set the root password the following instructions need to be added to local.conf:

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

No need to remove debug-tweaks




回答3:


Here is method I used which does not use the -P switch on the usermod command. You must use the following form:

EXTRA_USERS_PARAMS = "usermod -p $(openssl passwd p@ssw0rd) root;"

The usermod -P command does not work in my version of linux.

See How do i change the root password in the Yocto dora bitbake system?




回答4:


Add the below linw at your conf/local.conf file

INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "usermod -P urpassword root;"


来源:https://stackoverflow.com/questions/32274163/how-to-set-root-password-on-yocto-poky-image

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!