Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 899E4C021B8 for ; Sat, 1 Mar 2025 21:42:23 +0000 (UTC) Subject: Creating a hash of a password for my recipe to add a user To: poky@lists.yoctoproject.org From: "John" X-Originating-Location: Ottawa, Ontario, CA (184.175.41.163) X-Originating-Platform: Linux Chrome 133 User-Agent: GROUPS.IO Web Poster MIME-Version: 1.0 Date: Sat, 01 Mar 2025 13:42:15 -0800 Message-ID: Content-Type: multipart/alternative; boundary="jcaqD7GSZjcqLzsUZBxc" List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Sat, 01 Mar 2025 21:42:23 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/poky/message/13548 --jcaqD7GSZjcqLzsUZBxc Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable I tried the extrausers class and I didn't get any errors but I also got no = joy. Nothing was created on the target and I moved onto using the adduser e= xample from the meta-skeleton directories. I have joy now, the additional u= ser is created and I can see the user's home directory various entries requ= ired in all of the relevant files. yay! However I have this line in my recipe (ignore the underline): >=20 > NEWGUY_PASSWORD =3D > "\$6\$zap5cUSDzKQyKfmL\$g8RRKqDw8U9BlmQFO2GLDPvcGe5mWSnwhMtYbDeKpPEDULJ2y= LUhI6oHP4xq > /p7fbE2SftFy4bvPd.ZsHVS55. " >=20 >=20 I then have this to set the parameters for the added user: >=20 > USERADD_PARAM:${PN} =3D " -d /home/newguy \ > -m \ > -G tty,audio \ > -p ${NEWGUY_PASSWORD} \ > -U newguy \ > " >=20 I can't login to the board using the password I created using the command: >=20 > mkpasswd -m sha512crypt >=20 I escaped the character '$' as you can see and cut & pasted it to my recipe= file. When I boot the board, I can't login using those credentials (login = via ssh). I then login via the root account and here is what I find in the = "/etc/shadow" file: >=20 > newguy: /p7fbE2SftFy4bvPd.ZsHVS55. :15069:0:99999:7::: >=20 Now I presume the actual hash is the part that I've underlined and I guess = the rest is the SALT(?). Is there some other thing I have to do to the hash= to make it usable by the login application? Thanks in advance for any advice. Cheers!! --jcaqD7GSZjcqLzsUZBxc Content-Type: text/html; charset="utf-8" Content-Transfer-Encoding: quoted-printable
I tried the extrausers class and I didn't get any errors but I also go= t no joy. Nothing was created on the target and I moved onto using the addu= ser example from the meta-skeleton directories. I have joy now, the additio= nal user is created and I can see the user's home directory various entries= required in all of the relevant files. yay!
 
However I have this line in my recipe (ignore the underline):
 
NEWGUY_PASSWORD =3D "\$6\$zap5cUSDzKQyKfmL\$g8RRKqDw8U9BlmQFO2GLDPvcGe= 5mWSnwhMtYbDeKpPEDULJ2yLUhI6oHP4xq/p7fbE2SftFy4bvPd.ZsHVS55."
 
I then have this to set the parameters for the added user:
 
USERADD_PARAM:${PN} =3D " -d /home/newguy \
      =                   -m \
&n= bsp;                     =   -G tty,audio \
             =           -p ${NEWGUY_PASSWORD} \
  &nb= sp;                     -= U newguy \
                &nb= sp;     "
I can't login to the board using the password I created using the comm= and:
mkpasswd -m sha512crypt <yeah right... nice try>
 
I escaped the character '$' as you can see and cut & pasted it to = my recipe file. When I boot the board, I can't login using those credential= s (login via ssh). I then login via the root account and here is what I fin= d in the "/etc/shadow" file:
newguy:/p7fbE2SftFy4bvPd.Z= sHVS55.:15069:0:99999:7:::
 
Now I presume the actual hash is the part that I've underlined and I g= uess the rest is the SALT(?). Is there some other thing I have to do to the= hash to make it usable by the login application?
 
Thanks in advance for any advice.
 
Cheers!!
 
 
--jcaqD7GSZjcqLzsUZBxc--