All of lore.kernel.org
 help / color / mirror / Atom feed
* default root password
@ 2013-10-16 12:57 David Andrey
  2013-10-17 12:15 ` Diego Sueiro
  2013-10-17 13:23 ` Bryan Evenson
  0 siblings, 2 replies; 5+ messages in thread
From: David Andrey @ 2013-10-16 12:57 UTC (permalink / raw)
  To: yocto

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default root password
  2013-10-16 12:57 default root password David Andrey
@ 2013-10-17 12:15 ` Diego Sueiro
  2013-10-17 13:23 ` Bryan Evenson
  1 sibling, 0 replies; 5+ messages in thread
From: Diego Sueiro @ 2013-10-17 12:15 UTC (permalink / raw)
  To: David Andrey; +Cc: yocto@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

2013/10/16 David Andrey <David.Andrey@netmodule.com>

> 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
>

David,

Did you find another way to achieve this?

--
*dS
Diego Sueiro

/*long live rock 'n roll*/


> _______________________________________________
> yocto mailing list
> yocto@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/yocto
>

[-- Attachment #2: Type: text/html, Size: 1604 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default root password
  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
  1 sibling, 2 replies; 5+ messages in thread
From: Bryan Evenson @ 2013-10-17 13:23 UTC (permalink / raw)
  To: David Andrey, yocto@yoctoproject.org

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default root password
  2013-10-17 13:23 ` Bryan Evenson
@ 2013-10-17 13:29   ` Diego Sueiro
  2013-10-18  7:14   ` David Andrey
  1 sibling, 0 replies; 5+ messages in thread
From: Diego Sueiro @ 2013-10-17 13:29 UTC (permalink / raw)
  To: Bryan Evenson; +Cc: yocto@yoctoproject.org

[-- Attachment #1: Type: text/plain, Size: 857 bytes --]

2013/10/17 Bryan Evenson <bevenson@melinkcorp.com>

> 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.
>

Bryan,

I've tried that too.The issue raised for me was related to INHERIT +=
"extrausers", as soon as, it is not present on dylan branch.
So, I solved that with ROOTFS_POSTPROCESS_COMMAND strategy.

Regards,

--
*dS
Diego Sueiro

/*long live rock 'n roll*/

[-- Attachment #2: Type: text/html, Size: 1509 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: default root password
  2013-10-17 13:23 ` Bryan Evenson
  2013-10-17 13:29   ` Diego Sueiro
@ 2013-10-18  7:14   ` David Andrey
  1 sibling, 0 replies; 5+ messages in thread
From: David Andrey @ 2013-10-18  7:14 UTC (permalink / raw)
  To: Bryan Evenson, yocto

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2013-10-18  7:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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.