[elbe-devel] [PATCH v2 1/8] rfs: use chpasswd for root password

Bastian Germann bage at linutronix.de
Fri Jun 24 12:11:29 CEST 2022


Am 16.06.22 um 12:10 schrieb Holger Dengler:
> Use batch-mode tool "chpasswd" for setting the root password. It allows
> the processing of plain-text and hashed passwords.
> 
> Signed-off-by: Holger Dengler <holger at hdengler.de>

Reviewed-by: Bastian Germann <bage at linutronix.de>

> ---
>   elbepack/rfs.py | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/elbepack/rfs.py b/elbepack/rfs.py
> index 96ab97fde..4704eed61 100644
> --- a/elbepack/rfs.py
> +++ b/elbepack/rfs.py
> @@ -326,8 +326,8 @@ class BuildEnv:
>   
>       def seed_etc(self):
>           passwd = self.xml.text("target/passwd")
> -        stdin = "%s\n%s\n" % (passwd, passwd)
> -        chroot(self.rfs.path, "passwd", stdin=stdin)
> +        stdin = "root:%s" % (passwd)
> +        chroot(self.rfs.path, "chpasswd", stdin=stdin)
>   
>           hostname = self.xml.text("target/hostname")
>           fqdn = hostname


More information about the elbe-devel mailing list