[elbe-devel] [PATCH v1 06/15] finetuning: use hashed password for adduser

Holger Dengler holger at hdengler.de
Wed Jun 8 22:39:49 CEST 2022


Use the hashed password to set the password of an added user in the
target RFS.

Signed-off-by: Holger Dengler <holger at hdengler.de>
---
 elbepack/finetuning.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/elbepack/finetuning.py b/elbepack/finetuning.py
index 920d7bba3..a036d3e87 100644
--- a/elbepack/finetuning.py
+++ b/elbepack/finetuning.py
@@ -275,9 +275,9 @@ class AddUserAction(FinetuningAction):
                                                  self.node.et.text)
             chroot(target.path, cmd)
 
-            if 'passwd' in att:
-                stdin = "%s:%s" % (self.node.et.text, att["passwd"])
-                chroot(target.path, "chpasswd", stdin=stdin)
+            if 'passwd_hashed' in att:
+                stdin = "%s:%s" % (self.node.et.text, att["passwd_hashed"])
+                chroot(target.path, "chpasswd --encrypted", stdin=stdin)
 
 
 @FinetuningAction.register('addgroup')
-- 
2.36.1



More information about the elbe-devel mailing list