Re: Useradd: crypted passwords longer than 8 characters

Bryan Evenson


You can use the the EXTRA_USER_PARAMS variable in your image recipe: Both usermod and useradd take a plaintext password with the -P option, but I believe the password is then encrypted prior to being saved in /etc/shadow. Then you'll need to follow proper precautions to ensure your image recipe stays secret since it'd include the plaintext password.


-----Original Message-----
From: yocto-bounces@... <yocto-bounces@...>
On Behalf Of Mark Hatle
Sent: Monday, October 21, 2019 12:15 PM
To: Lukasz Zemla <Lukasz.Zemla@...>; yocto@...
Subject: Re: [yocto] Useradd: crypted passwords longer than 8 characters

Crypt the password yourself and pass it in to the adduser command.


On 10/21/19 10:25 AM, Lukasz Zemla wrote:
What is the best way in Yocto (warrior) to add crypted password to
/etc/shadow during buildtime?

Using useradd.bbclass in a standard way we may add only passwords <= 8
"-p" parameterr followed by the output of "openssl passwd -crypt
pAsswOrd" works fine.

I thought that class may be cheated by providing after "-p" string returned
by "openssl passwd -6 verylongpAsswOrd", but it does not work: the
password in /etc/shadow file is truncated:


Any suggestions?

Thank you in advance.
Lukasz Zemla

The information in this email is confidential and intended solely for the
individual or entity to whom it is addressed.  If you have received this email in
error please notify the sender by return e-mail, delete this email, and refrain
from any disclosure or action based on the information.
yocto mailing list

Join { to automatically receive all group messages.