From: "David Andrey" <David.Andrey@netmodule.com>
To: "Bryan Evenson" <bevenson@melinkcorp.com>, <yocto@yoctoproject.org>
Subject: Re: default root password
Date: Fri, 18 Oct 2013 09:14:30 +0200 [thread overview]
Message-ID: <1VX4GY-0001k9-Ty@wolf.netmodule.com> (raw)
In-Reply-To: <91586D499ADFD74FBCFB8425266A5DE40153B8DD503B@pluto.melinkcorp.local>
Hi Bryan,
Solved this using the ROOTFS_POSTPROCESS_COMMAND, but without the
patches series for > 8 characters password. Thanks for that input :-)
Using danny in this particular case.
Hope someone will update the FAQ !
Thanks
David
-----Original Message-----
From: Bryan Evenson [mailto:bevenson@melinkcorp.com]
Sent: jeudi 17 octobre 2013 15:23
To: David Andrey; yocto@yoctoproject.org
Subject: RE: default root password
David,
I've had similar issues, and this is what I've done to get the root
password set properly in my image. I am using poky/Dylan-9.0.1 for a
starting point.
1. In my case, I want a root password that is longer than 8 characters.
With poky/dylan, it is using tinylogin for password management which has
an issue with passwords longer than 8 characters; it looks like it is
using them, but it only pays attention to the first 8 characters. If
you want to use a root password that is longer than 8 characters, there
is a 10 patch series under poky/master submitted by Chen Qi on
2013-06-25. Cherry-pick these 10 patches and apply them to your local
poky repository. Rebuild your image with "debug-tweaks" set in
local.conf.
2. Boot up your newly built image with the default blank password (or
some other password you know what it is). Then, change the root
password using the passwd command. If you want a root password that is
longer than 8 characters, use "passwd -m".
3. Look at the contents of /etc/shadow. Everything between the first
two colons on root's line is its password. For example, if it looked
like this:
root:$QAGQ$%Y#QTRAG%^J#$#QR$@:15924:0:99999:7:::
then $QAGQ$%Y#QTRAG%^J#$#QR$@ would be root's encrypted password. Copy
that text.
4. Add the following to the end of your image recipe:
ROOTFS_POSTPROCESS_COMMAND += "\
sed 's%^root:[^:]*:%root:<encrypted_password_goes_here>:%' \
< ${IMAGE_ROOTFS}/etc/shadow \
> ${IMAGE_ROOTFS}/etc/shadow.new;\
mv ${IMAGE_ROOTFS}/etc/shadow.new ${IMAGE_ROOTFS}/etc/shadow ;"
and that will change root's password in your image.
I know there is the EXTRA_USER_PARAMS feature for adding users and
modifying a user's password, but I couldn't get it to work for root. I
tried adding:
INHERIT += "extrausers"
EXTRA_USERS_PARAMS = "\
usermod -p '<encrypted_password_goes_here>' root; \
"
and I would get errors when building the image. I can't remember the
errors I got, but I couldn't get the build to complete when I tried to
modify the root password in this manner. The other way worked so I went
with that.
Hope that helps.
-Bryan Evenson
> -----Original Message-----
> From: yocto-bounces@yoctoproject.org [mailto:yocto-
> bounces@yoctoproject.org] On Behalf Of David Andrey
> Sent: Wednesday, October 16, 2013 8:58 AM
> To: yocto@yoctoproject.org
> Subject: [yocto] default root password
>
> Hi,
>
> There are lot of threads floating around, and a FAQ without answer.
> https://wiki.yoctoproject.org/wiki/FAQ:How_do_I_set_or_change_the_root
> _
> p
> assword
>
> So what is the official way to set a default root password ?
> Using a sed command on /etc/passwd through ROOTFS_POSTPROCESS_COMMAND
> or is there any other built-in solution ?
>
> regards
> David
> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
prev parent reply other threads:[~2013-10-18 7:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-16 12:57 default root password David Andrey
2013-10-17 12:15 ` Diego Sueiro
2013-10-17 13:23 ` Bryan Evenson
2013-10-17 13:29 ` Diego Sueiro
2013-10-18 7:14 ` David Andrey [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1VX4GY-0001k9-Ty@wolf.netmodule.com \
--to=david.andrey@netmodule.com \
--cc=bevenson@melinkcorp.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.