Re: Useradd: crypted passwords longer than 8 characters


Bryan Evenson
 

Lukasz,

You can use the the EXTRA_USER_PARAMS variable in your image recipe: https://www.yoctoproject.org/docs/current/mega-manual/mega-manual.html#ref-classes-extrausers. 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.

-Bryan

-----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.

--Mark

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
characters.
"-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:

myuser:/D163GofCVEpMgZ.w2Ro3Z.b5S8XT1:18190:0:99999:7:::

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
yocto@...
https://lists.yoctoproject.org/listinfo/yocto

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.