How do i change the root password in the Yocto dora bitbake system?
Asked Answered
P

2

1

I am working on the Dora branch (Poky 1.2) of Yocto and need to work on this branch only.

I need to change the blank root password to some other value in order to prevent a security hole in the image during development.

How do I set the root password?

I would like to use the local.conf file.

The method described here does not work: How to set root password on Yocto / Poky image?

Protohistory answered 16/12, 2017 at 22:4 Comment(0)
K
1

Add the below line in your build/conf/local.conf or go to your meta-dir and add the below line for taking git patch.

INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "useradd admin; \
                      usermod -p $(openssl passwd abc123) admin; \
                      usermod -p $(openssl passwd knockknock) root; \
                     "
Kevin answered 18/12, 2017 at 7:16 Comment(0)
P
0

I found that the early version of poky does not accept the -P switch for the usermod in the local.conf file. (Maybe this is because I use Linux kernel 3.0)

In order to change the root password I needed to do the following: (I also added an admin user)

In my poky/build/conf/local.conf file I added the following lines:

INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "useradd admin; \
                      usermod -p $(openssl passwd abc123) admin; \
                      usermod -p $(openssl passwd knockknock) root; \
                     "

The password for admin is 'abc123' and the password for root is 'knockknock'.

I also added a recipe for the openssl to the image from poky/meta/recipes-connectivity/openssl/openssl_1.0.1p.bb

Protohistory answered 16/12, 2017 at 22:4 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.