On 27/11/19 12:06, Andy Pont wrote:
I tried this out on a build that I am working on for which I needed to add a root password and to create a non-root user with a password.

If I use:

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

When I try to login to the device it rejects the password that was defined as ROOT_PASSWORD.  If I remove the “-6” from the openssl command and rebuild/deploy the image then I can login to the target as expected.  Is there something else that needs to be defined/included in the Yocto configuration in order for the “-6” option to work?

-Andy.


Actually I'm using:

EXTRA_USERS_PARAMS = " usermod -p '$(openssl passwd -6 myrootpassword)' root;"

with success on warrior.

Sorry, I forgot to mention that with password algorithms like the -6 we need the two ' ' around the openssl command, because the generated hash contains the "$" character, that is resolved as a bash variable somewhere in the process.

But at this point I'm not sure if ${ROOT_PASSWORD} works (I'm using the password wrote on the command, not passed by variable).

Regards

--
Mauro

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.

View/Reply Online (#47435): https://lists.yoctoproject.org/g/yocto/message/47435
Mute This Topic: https://lists.yoctoproject.org/mt/61917008/21656
Group Owner: yocto+ow...@lists.yoctoproject.org
Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to