[meta-freescale] default root password or password request

Uhl, Joe juhl at gai-tronics.com
Mon Nov 17 05:16:05 PST 2014


-----Original Message-----
From: meta-freescale-bounces at yoctoproject.org [mailto:meta-freescale-bounces at yoctoproject.org] On Behalf Of Matthias.Heise at atlas-elektronik.com
Sent: Monday, November 17, 2014 6:06 AM
To: meta-freescale at yoctoproject.org
Subject: Re: [meta-freescale] default root password or password request

Did actually no one ever want to add a root password (or a new user WITH password) via recipe ?
Btw the command  "useradd -p password tester;" does not work on the console either so why should it in the .conf or recipe ;-) Although I read something like above in the examples, (with clear-text password) somewhere I also read that the password parameter expects the crypted password.
I tried setting one and then copied it from the /etc/shadow into the .conf but it didn't work either. Or is that the problem, that shadow is used here ?


>>>>>
These links might be of help:
http://www.linuxquestions.org/questions/linux-newbie-8/useradd-p-encrypted-password-520847/
https://wiki.yoctoproject.org/wiki/FAQ:How_do_I_set_or_change_the_root_password

The below example (placed at bottom of image recipe) will add a new user and set an encrypted password as well as add a password to root (which is root).  See the link above on how to get the encrypted password.  Be sure to escape the $'s.

inherit extrausers
EXTRA_USERS_PARAMS = "useradd -p 'encrypted password for newuser' newuser;"
ROOTFS_POSTPROCESS_COMMAND += "set_root_passwd;"
set_root_passwd() {
	sed 's%^root:[^:]*:%root:wYNffsf6sozwE:%' \
	< ${IMAGE_ROOTFS}/etc/shadow \
	> ${IMAGE_ROOTFS}/etc/shadow.new;
	mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;
}	



---------------------------------------------------------------------------------------------------------------------------- 
Confidentiality Requirement: This communication, including any attachment(s), may contain confidential information and is for the sole use of the intended recipient(s). If you are not the intended recipient, you are hereby notified that you have received this communication in error and any unauthorized review, use, disclosure, dissemination, distribution or copying of it or its contents is strictly prohibited.  If you have received this communication in error, please notify the sender immediately by telephone or e-mail and destroy all copies of this communication and any attachments.



More information about the meta-freescale mailing list