<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"><!-- P {margin-top:0;margin-bottom:0;} --></style>
</head>
<body dir="ltr">
<div id="divtagdefaultwrapper" style="font-size:12pt;color:#000000;font-family:Calibri,Arial,Helvetica,sans-serif;">
<p>Hi Rudolf,</p>
<p>1st, yes I inherit extrausers. Attached are the passwd & shadow files.</p>
<p><br>
</p>
<p>It shouldn't make any difference, but I'm building this for an RPi3 using the Qt Boot2Qt version of the Yocto environment, distro 2.5.3.</p>
<p><br>
</p>
Greg<br>
<br>
<div style="color: rgb(0, 0, 0);">
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Rudolf J Streif <rudolf.streif@ibeeto.com><br>
<b>Sent:</b> Wednesday, May 15, 2019 11:26 AM<br>
<b>To:</b> Greg Wilson-Lindberg; Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</font>
<div> </div>
</div>
<div>
<p>Hi Greg,</p>
<p><br>
</p>
<p>> I've also tried both the back-quote and the single-quote, no difference.</p>
<p><br>
</p>
<p>Help me to understand this. the back-quotes are the right ones. If you use the single ones your password in the /etc/shadow ends up being 'openssl passwd test' (without the quotes), unless the build fails because of a parsing error (I have not tried it).
Silly question, you did inherit extrausers class?</p>
<p><br>
</p>
<p>Can you post your /etc/passwd and /etc/shadow</p>
<p><br>
</p>
<p>I am surprised that this does not work with your setup. I have been doing this a gazillion times always with success.</p>
<p><br>
</p>
<p>:rjs<br>
</p>
<p><br>
</p>
<p><br>
</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 5/15/19 11:03 AM, Greg Wilson-Lindberg wrote:<br>
</div>
<blockquote type="cite">
<meta name="Generator" content="Microsoft Exchange Server">
<meta content="text/html; charset=UTF-8">
<div dir="ltr">
<div id="x_divtagdefaultwrapper" style="font-size:12pt; color:#000000; font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Hi Rudolf,</p>
<p>Thanks for the reply, and the information on how openssl works.</p>
<p><br>
</p>
<p>I'm trying to create a user with the same group name so the code that I'm using reduces to:</p>
<div style="color:#000000; background-color:#ffffff; font-style:normal; font-weight:normal; text-decoration:none">
<pre>EXTRA_USERS_PARAMS = "\
useradd -p `openssl passwd test` sakura; \
usermod -a -G sudo ${SAKURA_USER}; \
"
</pre>
</div>
I also, as you can see, removed the macros to eliminate as much confusion as possible.
<p><br>
</p>
<p>I still can't login in using the password<span style=""> 'test'</span>.</p>
<p><br>
</p>
<p>I've also tried both the back-quote and the single-quote, no difference.</p>
<p>Regards,</p>
<p><br>
</p>
<p>Greg</p>
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> Rudolf J Streif
<a class="moz-txt-link-rfc2396E" href="mailto:rudolf.streif@ibeeto.com"><rudolf.streif@ibeeto.com></a><br>
<b>Sent:</b> Wednesday, May 15, 2019 10:07:47 AM<br>
<b>To:</b> Greg Wilson-Lindberg; Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</font>
<div> </div>
</div>
</div>
<font size="2"><span style="font-size:10pt">
<div class="PlainText">Hi Greg,<br>
<br>
Well, I suppose I wrote the book you are referring to...<br>
<br>
<br>
Using<br>
<br>
useradd -p PASSWORD USER<br>
<br>
takes the password hash for PASSWORD hence the use of openssl in:<br>
<br>
useadd -p `openssl passwd PASSWORD` USER<br>
<br>
openssl password creates the password hash using the original crypt hash <br>
algorithm if no other options are specified. e.g.<br>
<br>
$ openssl passwd hello<br>
6hEsTksgRkeiI<br>
<br>
With this the first two characters of the output is the salt and the <br>
rest is the password hash. If you want openssl to create the same result <br>
again:<br>
<br>
$ openssl passwd -salt "6h" hello<br>
6hEsTksgRkeiI<br>
<br>
You can use newer algorithms like MD5 based BSD password algorithm 1:<br>
<br>
$ openssl passwd -1 hello<br>
$1$4Mu8Fcs.$eIKgPP7RCYrb3lFZjhADA1<br>
<br>
$1 : password algorithm 1<br>
$4Mu8Fcs. : salt<br>
$eIKgPP7RCYrb3lFZjhADA1 : password hash<br>
<br>
<br>
If you log into the system you have to use the clear password. The <br>
system reads the salt, creates the password hash and compares the results.<br>
<br>
<br>
:rjs<br>
<br>
<br>
On 5/14/19 5:34 PM, Greg Wilson-Lindberg wrote:<br>
> I'm trying to use the example in "Embedded Linux Systems with the Yocto Project" to add a user to my Yocto build. In the book the sample code:<br>
><br>
> useradd -p `openssl passwd ${DEV_PASSWORD}` developer; \<br>
><br>
> uses openssl to generate the encrypted password string to pass to useradd. I have never been able to get this to work. When I run the openssl<br>
> command on the cmd line I get a different value every time, this seems wrong, How can the password code compare against it if every encode<br>
> produces a different value?<br>
><br>
> I am getting the user added to the system, the home directory shows up and the user is in the passwd and group files. I just can't login to the<br>
> account.<br>
><br>
> I've obviously got something confused, any help would be appreciated.<br>
><br>
> Greg Wilson-Lindberg<br>
> <br>
<br>
-- <br>
-----<br>
Rudolf J Streif<br>
CEO/CTO ibeeto<br>
+1.855.442.3396 x700<br>
<br>
</div>
</span></font></blockquote>
<pre class="moz-signature" cols="72">--
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3396 x700</pre>
</div>
</div>
</div>
</body>
</html>