简体   繁体   English

如何在Yocto / Poky图像上设置root密码?

[英]How to set root password on Yocto / Poky image?

I am building an image with Yocto/Poky release Daisy 1.6.3. 我正在使用Yocto / Poky发布Daisy 1.6.3构建图像。
What is the correct way or config file where to set the root password? 什么是正确的方式或配置文件在哪里设置root密码? The default password is empty and I can't find a place where to specify it. 默认密码为空,我找不到指定它的位置。

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. 其中p @ ssw0rd是您希望root用户拥有的密码。

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. 由于“调试调整”的目标是将root的密码设置为空,因此必须将其从EXTRA_IMAGE_FEATURES中删除。

As of Poky 2.1.2; 截至Poky 2.1.2; to set the root password the following instructions need to be added to local.conf: 要设置root密码,需要将以下说明添加到local.conf:

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

No need to remove debug-tweaks 无需删除debug-tweaks

Here is method I used which does not use the -P switch on the usermod command. 这是我使用的方法,它不使用usermod命令上的-P开关。 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. usermod -P命令在我的linux版本中不起作用。

See How do i change the root password in the Yocto dora bitbake system? 请参阅如何更改Yocto dora bitbake系统中的root密码?

Add the below linw at your conf/local.conf file conf/local.conf文件中添加以下linw

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM