<div dir="ltr">Greg,<div><br></div><div>It eluded me earlier but in both instances the variable containing the password does not seem to be expanded.</div><div><br></div><div>First version without the single quotes:</div><div><br></div><div><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">SAKURA_PASS = "$1$QVO3K6Ii$</span><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">fvkoDKnlzz3d5uVoL7KcM0"</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">EXTRA_USERS_PARAMS = "\</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    usermod -p ${SAKURA_PASS} ${SAKURA_USER}; \</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    usermod -a -G sudo,dialout ${SAKURA_USER}; \</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    "</span><br></div><div><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">results in:</span></div><div><br></div><div><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:16px">NOTE: scribe: Performing usermod with [-R /home/gwilson/Qt/Qt-5.12.3/Yocto-build-RPi3/build-raspberrypi3/tmp/work/raspberrypi3-poky-linux-gnueabi/scribe/1.0-r0/rootfs -p sakura]</pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:16px"><font face="times new roman, serif">and with the quotes:</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:16px"><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;white-space:normal"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">SAKURA_PASS = "$1$QVO3K6Ii$</span><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">fvkoDKnlzz3d5uVoL7KcM0"</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">EXTRA_USERS_PARAMS = "\</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    usermod -p '${SAKURA_PASS}' ${SAKURA_USER}; \</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    usermod -a -G sudo,dialout ${SAKURA_USER}; \</span><br style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">    "</span><br></div><div style="color:rgb(34,34,34);font-family:Arial,Helvetica,sans-serif;font-size:small;white-space:normal"><span style="color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif;font-size:16px">results in:</span></div>NOTE: scribe: Performing usermod with [-R /home/gwilson/Qt/Qt-5.12.3/Yocto-build-RPi3/build-raspberrypi3/tmp/work/raspberrypi3-poky-linux-gnueabi/scribe/1.0-r0/rootfs -p '' sakura]<br class="gmail-Apple-interchange-newline"></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:16px"><font face="times new roman, serif">It looks as if the variable SAKURA_PASS is not set at all. I looked at your <a href="http://scribe.bb">scribe.bb</a> recipe you attached earlier but I could not find any reason why the variable is not set. Is there a chance that it is overridden somewhere elase?</font></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0);font-size:16px">:rjs</pre></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, May 22, 2019 at 1:28 PM Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com">GWilson@sakuraus.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">



<div>

<div id="gmail-m_3437460169442067041divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Rudolf,</p>
<p>Here is the first half of the file,  the whole file is over the 500k limit of free pastebin:</p>
<p><a href="https://pastebin.com/UcnKebce" class="gmail-m_3437460169442067041OWAAutoLink" id="gmail-m_3437460169442067041LPlnk853779" target="_blank">https://pastebin.com/UcnKebce</a><br>
</p>
<p><br>
</p>
<p>And here is the 2nd half of the file:</p>
<p><a href="https://pastebin.com/9117tdUU" class="gmail-m_3437460169442067041OWAAutoLink" id="gmail-m_3437460169442067041LPlnk630047" target="_blank">https://pastebin.com/9117tdUU</a><br>
</p>
<p><br>
</p>
<p>Greg</p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_3437460169442067041divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Rudolf Streif <<a href="mailto:rudolf.streif@ibeeto.com" target="_blank">rudolf.streif@ibeeto.com</a>><br>
<b>Sent:</b> Wednesday, May 22, 2019 12:42:40 PM<br>
<b>To:</b> Greg Wilson-Lindberg<br>
<b>Cc:</b> Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</font>
<div> </div>
</div>
<div>
<div dir="ltr">Greg,
<div>Can you share the logfile via Pastebin?</div>
<div>:rjs</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, May 21, 2019 at 11:09 AM Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com" target="_blank">GWilson@sakuraus.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p>Rudolf,</p>
<p>Something else is happening to me. I changed to this in the image recipe:</p>
<p></p>
<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-style:normal;font-weight:normal;text-decoration:none">
<pre></pre>
</div>
<p></p>
<div>SAKURA_USER = "sakura"<br>
<br>
SAKURA_PASSWD = "Distracted"<br>
SAKURA_PASS = "$1$QVO3K6Ii$fvkoDKnlzz3d5uVoL7KcM0"<br>
<br>
EXTRA_USERS_PARAMS = "\<br>
    usermod -p '${SAKURA_PASS}' ${SAKURA_USER}; \<br>
    usermod -a -G sudo,dialout ${SAKURA_USER}; \<br>
    "<br>
</div>
<p>deleting all of the commented out lines, and I get this in the log file:</p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">..../scribe/1.0-r0/rootfs -p '' sakura]</span><br>
</p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">nothing between the single quotes. It's acting like SAKURA_PASS is not defined.</span></p>
<p><span style="font-size:12pt">This is only happening when I'm trying the MD5 password.</span></p>
<p><span style="font-size:12pt"><br>
</span></p>
<p><span style="font-size:12pt">Greg</span></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Rudolf Streif <<a href="mailto:rudolf.streif@ibeeto.com" target="_blank">rudolf.streif@ibeeto.com</a>><br>
<b>Sent:</b> Tuesday, May 21, 2019 5:37:23 AM<br>
<b>To:</b> Greg Wilson-Lindberg<br>
<b>Cc:</b> Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</font>
<div> </div>
</div>
<div>
<div dir="auto">Greg,
<div dir="auto"><br>
</div>
<div dir="auto">usermod does not work for the MD5 algorithm with the explicit password hash as it contains the $ field delimiters which are interpreted by the shell executing the usermod command. Use single quotes around the password hash:</div>
<div dir="auto"><br>
</div>
<div dir="auto">usermod -p '${SAKURA_PASS}' ${SAKURA_USER};<br>
</div>
<div dir="auto"><br>
</div>
<div dir="auto">:rjs</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Mon, May 20, 2019, 11:55 Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com" target="_blank">GWilson@sakuraus.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811divtagdefaultwrapper" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif">
<p></p>
<div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-style:normal;font-weight:normal;text-decoration:none">
<pre>Hi Rudolf,

I've had more time to work with this and I'm still having problems getting 
everything to work properly. I've attached the image recipe recipe that I'm 
using so I don't leave any thing out that may be relevant.

When I build with a password that is no more more than 8 characters long
and no non-alphabetic characters:</pre>
<pre><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-style:normal;font-weight:normal;text-decoration:none"><pre>SAKURA_PASSWD = "Distract"
SAKURA_PASS = "WRsDFfg1BsrDM"
</pre></div></pre>
<pre>everything works correctly. 

I first tried that using the `openssl ...` form, and then I tried the 
-1, MD5 BSD form and had problems, so I changed to doing the openssl 
on the command line and making sure that I don't have any characters 
that display as '.' or '/'. Again, if I don't do more than 8 characters
and no special characters everything works.

When I changed to using 'Ds$tr@ct' it stopped working. The build finishes
and the log file shows the usermod being exectued correctly:

NOTE: scribe: Performing usermod with [-R /home/gwilson/Qt/Qt-5.12.3/Yocto-build-RPi3/build-raspberrypi3/tmp/work/raspberrypi3-poky-linux-gnueabi/scribe/1.0-r0/rootfs -p kyNsrvS0elMWU sakura]
NOTE: scribe: Performing usermod with [-R /home/gwilson/Qt/Qt-5.12.3/Yocto-build-RPi3/build-raspberrypi3/tmp/work/raspberrypi3-poky-linux-gnueabi/scribe/1.0-r0/rootfs -a -G sudo,dialout sakura]

But when I try to sign in it doesn't work.

I then tried the 10 character password 'Distracted', the build fails:

NOTE: scribe: Performing usermod with [-R /home/gwilson/Qt/Qt-5.12.3/Yocto-build-RPi3/build-raspberrypi3/tmp/work/raspberrypi3-poky-linux-gnueabi/scribe/1.0-r0/rootfs -p sakura]
Usage: usermod [options] LOGIN

Options:
  -c, --comment COMMENT         new value of the GECOS field
  -d, --home HOME_DIR           new home directory for the user account
  -e, --expiredate EXPIRE_DATE  set account expiration date to EXPIRE_DATE
  -f, --inactive INACTIVE       set password inactive after expiration
                                to INACTIVE
  -g, --gid GROUP               force use GROUP as new primary group
  -G, --groups GROUPS           new list of supplementary GROUPS
  -a, --append                  append the user to the supplemental GROUPS
                                mentioned by the -G option without removing
                                him/her from other groups
  -h, --help                    display this help message and exit
  -l, --login NEW_LOGIN         new value of the login name
  -L, --lock                    lock the user account
  -m, --move-home               move contents of the home directory to the
                                new location (use only with -d)
  -o, --non-unique              allow using duplicate (non-unique) UID
  -p, --password PASSWORD       use encrypted password for the new password
  -P, --clear-password PASSWORD use clear password for the new password
  -R, --root CHROOT_DIR         directory to chroot into
  -s, --shell SHELL             new login shell for the user account
  -u, --uid UID                 new UID for the user account
  -U, --unlock                  unlock the user account
  -v, --add-subuids FIRST-LAST  add range of subordinate uids
  -V, --del-subuids FIRST-LAST  remove range of subordinate uids
  -w, --add-subgids FIRST-LAST  add range of subordinate gids
  -W, --del-subgids FIRST-LAST  remove range of subordinate gids

ERROR: scribe: usermod command did not succeed.

So, even though I'm putting in the openssl output:
openssl passwd -1 "Distracted"
$1$QVO3K6Ii$fvkoDKnlzz3d5uVoL7KcM0

that I get back from what should be a valid run of openssl, I don't see anything
from the password on the usermod command line:
 "...linux-gnueabi/scribe/1.0-r0/rootfs -p sakura]"

I don't understand why the short passwords and passing along the proper hash works, 
but not the longer password.

It also doesn't make sense that I can't put in the '$' & '@' characters and 
have them work.

Any suggestions would be greatly appreciated.</pre>
<pre><span style="font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols;font-size:12pt">Greg</span>
</pre>
</div>
<p></p>
</div>
<hr style="display:inline-block;width:98%">
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811divRplyFwdMsg" dir="ltr">
<font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Rudolf Streif <<a href="mailto:rudolf.streif@ibeeto.com" rel="noreferrer" target="_blank">rudolf.streif@ibeeto.com</a>><br>
<b>Sent:</b> Wednesday, May 15, 2019 4:58:26 PM<br>
<b>To:</b> Greg Wilson-Lindberg<br>
<b>Cc:</b> Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</font>
<div> </div>
</div>
<div>
<div dir="auto">Glad to hear that it works now. I am planning on attending the YP DevDay.
<div dir="auto"><br>
</div>
<div dir="auto">:rjs</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Wed, May 15, 2019, 13:53 Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com" rel="noreferrer" target="_blank">GWilson@sakuraus.com</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="white" lang="EN-US">
<div class="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355WordSection1">
<p class="MsoNormal"><span style="font-size:11pt;font-family:Arial,sans-serif;color:black">Thank you very much, that got me back on the right path.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Arial,sans-serif;color:black">Maybe I'll see you at the Yocto day at the Embedded Linux Conference.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Arial,sans-serif;color:black">Regards,<u></u><u></u></span></p>
<div>
<table class="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="97%" style="width:97.66%">
<tbody>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><img width="36" height="7" id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355Picture_x0020_1" alt="cid:image001.png@01D35D7D.179A7510"><u></u><u></u></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><b><span style="font-size:11pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(0,137,209)">Greg Wilson-Lindberg 
<u></u><u></u></span></b></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><b><span style="font-size:11pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">Principal Firmware Engineer | Sakura Finetek USA, Inc. 
<u></u><u></u></span></b></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><b><span style="font-size:10.5pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)"> <u></u><u></u></span></b></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">1750 W 214<sup>th</sup> Street | Torrance, CA 90501 | U.S.A. 
<u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span lang="DE" style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">T: +1 310 783 5075 
<u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span lang="DE" style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">F: +1 310 618 6902 | E: </span><span lang="DE" style="font-size:11pt;line-height:105%;font-family:Calibri,sans-serif;color:black"><a href="mailto:gwilson@sakuraus.com" rel="noreferrer noreferrer" target="_blank"><span style="color:rgb(5,99,193)">gwilson</span><span style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(5,99,193)">@sakuraus.com</span></a></span><span lang="DE" style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">  
 Â Â  <u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span style="font-size:11pt;line-height:105%;font-family:Calibri,sans-serif;color:black"><a href="http://www.sakuraus.com" rel="noreferrer noreferrer" target="_blank"><span style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(0,137,209);text-decoration:none">www.sakuraus.com</span></a></span><span style="font-size:10pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(0,137,209)">           
<u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span style="font-size:9pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)"> <u></u><u></u></span></p>
</td>
</tr>
<tr>
<td style="padding:0in">
<table class="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355MsoNormalTable" border="0" cellspacing="0" cellpadding="0" align="left" width="100%" style="width:100%;margin-bottom:5.75pt">
<tbody>
<tr>
<td valign="bottom" style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><img border="0" width="188" height="12" id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355Picture_x0020_2" alt="cid:image002.png@01D35D7D.179A7510"><u></u><u></u></p>
</td>
<td width="80" valign="bottom" style="width:60pt;padding:0in">
<p class="MsoNormal" align="right" style="text-align:right;line-height:105%"><img border="0" width="66" height="64" id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355Picture_x0020_3" alt="cid:image003.png@01D35D7D.179A7510"><u></u><u></u></p>
</td>
</tr>
</tbody>
</table>
</td>
</tr>
<tr>
<td style="padding:0in">
<div class="MsoNormal" align="center" style="text-align:center;line-height:105%">
<hr size="2" width="100%" align="center">
</div>
</td>
</tr>
<tr>
<td style="padding:0in">
<p class="MsoNormal" style="line-height:105%"><span style="font-size:7pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)">Confidentiality Notice: This e-mail transmission may contain confidential or legally privileged information that is intended
 only for the individual or entity named in the e-mail address. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution, or reliance upon the contents of this e-mail is strictly prohibited. If you have received
 this e-mail transmission in error, please reply to the sender, so that Sakura Finetek USA, Inc. can arrange for proper delivery, and then please delete the message from your inbox. Thank you.</span><span style="font-size:7pt;line-height:105%;font-family:Arial,sans-serif;color:rgb(88,89,91)"><u></u><u></u></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Calibri,sans-serif;color:black"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal"><span style="font-size:11pt;font-family:Arial,sans-serif;color:black"><u></u> <u></u></span></p>
<div style="border-top:none;border-right:none;border-bottom:none;border-left:1.5pt solid blue;padding:0in 0in 0in 4pt">
<div>
<div style="border-right:none;border-bottom:none;border-left:none;border-top:1pt solid rgb(225,225,225);padding:3pt 0in 0in">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif;color:windowtext">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif;color:windowtext"> Rudolf J Streif [mailto:<a href="mailto:rudolf.streif@ibeeto.com" rel="noreferrer noreferrer" target="_blank">rudolf.streif@ibeeto.com</a>]
<br>
<b>Sent:</b> Wednesday, May 15, 2019 01:30 PM<br>
<b>To:</b> Greg Wilson-Lindberg <<a href="mailto:GWilson@sakuraus.com" rel="noreferrer noreferrer" target="_blank">GWilson@sakuraus.com</a>>; Yocto list discussion <<a href="mailto:yocto@yoctoproject.org" rel="noreferrer noreferrer" target="_blank">yocto@yoctoproject.org</a>><br>
<b>Subject:</b> Re: [yocto] problem adding a user<u></u><u></u></span></p>
</div>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
<p>Instead of<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>useradd -p `openssl passwd test` sakura<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>which attempts to add the user and set the password which fails if the user already exists, use<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>usermod -p `openssl passwd test` sakura<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>which sets the user's password.<u></u><u></u></p>
<p><u></u> <u></u></p>
<p>:rjs<u></u><u></u></p>
<p><u></u> <u></u></p>
<div>
<p class="MsoNormal">On 5/15/19 1:18 PM, Greg Wilson-Lindberg wrote:<u></u><u></u></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355divtagdefaultwrapper">
<p><span style="font-family:Calibri,sans-serif">Ok, I had been using the useradd class in a couple of other recipes to allow me to copy files to the sakura user directory and another location, but owned by sakura. That seems to have been what was causing the
 problem.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">I had been using the extrausers class in my top level image recipe.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><br>
So now how do I get all of this to work together? Do I need to put everything that touches the sakura user in the same recipe? It seems that I need to use only one of the useradd or extrausers classes?<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-family:Calibri,sans-serif">Greg<u></u><u></u></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:Calibri,sans-serif">
<hr size="2" width="98%" align="center">
</span></div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Rudolf J Streif
<a href="mailto:rudolf.streif@ibeeto.com" rel="noreferrer noreferrer" target="_blank">
<rudolf.streif@ibeeto.com></a><br>
<b>Sent:</b> Wednesday, May 15, 2019 12:31 PM<br>
<b>To:</b> Greg Wilson-Lindberg; Yocto list discussion<br>
<b>Subject:</b> Re: [yocto] problem adding a user</span><span style="font-family:Calibri,sans-serif">
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif"> <u></u><u></u></span></p>
</div>
</div>
<div>
<p><span style="font-family:Calibri,sans-serif">The ! for the password in /etc/shadow indicates that the account is disabled:<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">sakura:!:18031:0:99999:7:::<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">Either there is something wrong with the password generation or it gets disabled by something else. Maybe it's worth trying with a plain image without Boot2Qt or anything else.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">:rjs<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif">On 5/15/19 11:46 AM, Greg Wilson-Lindberg wrote:<u></u><u></u></span></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355divtagdefaultwrapper">
<p><span style="font-family:Calibri,sans-serif">Hi Rudolf,<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">1st, yes I inherit extrausers. Attached are the passwd & shadow files.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">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.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-family:Calibri,sans-serif">Greg<u></u><u></u></span></p>
<div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:Calibri,sans-serif">
<hr size="2" width="98%" align="center">
</span></div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Rudolf J Streif
<a href="mailto:rudolf.streif@ibeeto.com" rel="noreferrer noreferrer" target="_blank">
<rudolf.streif@ibeeto.com></a><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</span><span style="font-family:Calibri,sans-serif">
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif"> <u></u><u></u></span></p>
</div>
</div>
<div>
<p><span style="font-family:Calibri,sans-serif">Hi Greg,<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">> I've also tried both the back-quote and the single-quote, no difference.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">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?<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">Can you post your /etc/passwd and /etc/shadow<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">I am surprised that this does not work with your setup. I have been doing this a gazillion times always with success.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">:rjs<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif">On 5/15/19 11:03 AM, Greg Wilson-Lindberg wrote:<u></u><u></u></span></p>
</div>
<blockquote style="margin-top:5pt;margin-bottom:5pt">
<div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355x_divtagdefaultwrapper">
<p><span style="font-family:Calibri,sans-serif">Hi Rudolf,<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">Thanks for the reply, and the information on how openssl works.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">I'm trying to create a user with the same group name so the code that I'm using reduces to:<u></u><u></u></span></p>
<div>
<pre style="background:white">EXTRA_USERS_PARAMS = "\<u></u><u></u></pre>
<pre style="background:white">    useradd -p `openssl passwd test` sakura; \<u></u><u></u></pre>
<pre style="background:white">    usermod -a -G sudo ${SAKURA_USER}; \<u></u><u></u></pre>
<pre style="background:white">    "<u></u><u></u></pre>
</div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif">I also, as you can see, removed the macros to eliminate as much confusion as possible.
<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">I still can't login in using the password 'test'.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">I've also tried both the back-quote and the single-quote, no difference.<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">Regards,<u></u><u></u></span></p>
<p><span style="font-family:Calibri,sans-serif"><u></u> <u></u></span></p>
<p><span style="font-family:Calibri,sans-serif">Greg<u></u><u></u></span></p>
</div>
<div class="MsoNormal" align="center" style="text-align:center"><span style="font-family:Calibri,sans-serif">
<hr size="2" width="98%" align="center">
</span></div>
<div id="gmail-m_3437460169442067041gmail-m_8411916321849903678m_-4811443116236749811m_-4293760156557775355x_divRplyFwdMsg">
<p class="MsoNormal"><b><span style="font-size:11pt;font-family:Calibri,sans-serif">From:</span></b><span style="font-size:11pt;font-family:Calibri,sans-serif"> Rudolf J Streif
<a href="mailto:rudolf.streif@ibeeto.com" rel="noreferrer noreferrer" target="_blank">
<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</span><span style="font-family:Calibri,sans-serif">
<u></u><u></u></span></p>
<div>
<p class="MsoNormal"><span style="font-family:Calibri,sans-serif"> <u></u><u></u></span></p>
</div>
</div>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12pt"><span style="font-size:10pt;font-family:Calibri,sans-serif">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<u></u><u></u></span></p>
</div>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre>-----<u></u><u></u></pre>
<pre>Rudolf J Streif<u></u><u></u></pre>
<pre>CEO/CTO ibeeto<u></u><u></u></pre>
<pre>+1.855.442.3396 x700<u></u><u></u></pre>
</div>
</div>
</div>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre>-----<u></u><u></u></pre>
<pre>Rudolf J Streif<u></u><u></u></pre>
<pre>CEO/CTO ibeeto<u></u><u></u></pre>
<pre>+1.855.442.3396 x700<u></u><u></u></pre>
</div>
</div>
</div>
</blockquote>
<pre>-- <u></u><u></u></pre>
<pre>-----<u></u><u></u></pre>
<pre>Rudolf J Streif<u></u><u></u></pre>
<pre>CEO/CTO ibeeto<u></u><u></u></pre>
<pre>+1.855.442.3396 x700<u></u><u></u></pre>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
-- <br>
<div dir="ltr" class="gmail-m_3437460169442067041gmail_signature">
<div dir="ltr">Rudolf J Streif
<div>CEO/CTO</div>
<div>ibeeto, Streif Enterprises Inc.</div>
</div>
</div>
</div>
</div>

</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Rudolf J Streif<div>CEO/CTO</div><div>ibeeto, Streif Enterprises Inc.</div></div></div>