[elbe-devel] [PATCH v3 1/7] rfs: use chpasswd for root password

Holger Dengler holger at hdengler.de
Thu Jun 30 08:00:01 CEST 2022


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



More information about the elbe-devel mailing list