Re: [poky] Creating a hash of a password for my recipe to add a user
Alexander Kanavin <[email protected]>
| Newsgroups | org.yoctoproject.lists.poky |
|---|---|
| Message-ID | <CANNYZj8UTJwUsg=f1CsXYO8rjNUmdaTprwEZWaOfiyn9bfXAmQ@mail.gmail.com> |
You probably need to study the logs for the recipe (in
${WORKDIR}/temp) to see what useradd command line actually looks like.
Possibly something gets mangled?
You can also experiment with this on the target (e.g add more users
and see if you can login as them).
Alex
On Sat, 1 Mar 2025 at 22:42, John via lists.yoctoproject.org
<[email protected]> wrote:
>
> 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 example from the meta-skeleton directories. I have joy now, the additional 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 = "\$6\$zap5cUSDzKQyKfmL\$g8RRKqDw8U9BlmQFO2GLDPvcGe5mWSnwhMtYbDeKpPEDULJ2yLUhI6oHP4xq/p7fbE2SftFy4bvPd.ZsHVS55."
>
>
> I then have this to set the parameters for the added user:
>
>
> USERADD_PARAM:${PN} = " -d /home/newguy \
> -m \
> -G tty,audio \
> -p ${NEWGUY_PASSWORD} \
> -U newguy \
> "
>
> I can't login to the board using the password I created using the command:
>
> 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 credentials (login via ssh). I then login via the root account and here is what I find in the "/etc/shadow" file:
>
> newguy:/p7fbE2SftFy4bvPd.ZsHVS55.:15069:0:99999:7:::
>
>
> 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!!
>
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#13548): https://lists.yoctoproject.org/g/poky/message/13548
> Mute This Topic: https://lists.yoctoproject.org/mt/111460955/1686489
> Group Owner: [email protected]
> Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
>