Creating a hash of a password for my recipe to add a user
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):
Quoted 6 lines
NEWGUY_PASSWORD= "\$6\$zap5cUSDzKQyKfmL\$g8RRKqDw8U9BlmQFO2GLDPvcGe5mWSnwhMtYbDeKpPEDULJ2yLUhI6oHP4xq /p7fbE2SftFy4bvPd.ZsHVS55. "
I then have this to set the parameters for the added user:
Quoted 8 lines
USERADD_PARAM:${PN} = " -d
/home/newguy\(quoted diff) +0
-4-m \ -G tty,audio \ -p ${NEWGUY_PASSWORD} \ -U newguy \"
I can't login to the board using the password I created using the command:
Quoted 3 lines
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:
Quoted 3 lines
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!!
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
Quoted 45 lines · John via lists.yoctoproject.org
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]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 4 lines · Alexander Kanavin via lists.yoctoproject.org
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?
Quoted 23 lines
You can also experiment with this on the target (e.g add more users and see if you can login as them).
Alex
Quoted 16 lines · John via lists.yoctoproject.org
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} \
It's single quoted in the meta-skeleton recipe, so maybe consider doing that as well?
Quoted 7 lines
Quoted 7 lines
-U newguy \ "I can't login to the board using the password I created using the command:
mkpasswd -m sha512crypt <yeah right... nice try>
We do document how to generate the password in the docs:
printf "%q" $(mkpasswd -m sha256crypt <your-pass>)
With <your-pass> being replaced with the actual string you want to use as password.
I don't know if sha512crypt is supported (maybe, but I don't know :) ).
Cheers,
Quentin
see
Quoted 45 lines · John via lists.yoctoproject.org
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/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/poky/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-