Creating a hash of a password for my recipe to add a user
"John" <[email protected]>
| Newsgroups | org.yoctoproject.lists.poky |
|---|---|
| Message-ID | <[email protected]> |
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!!