Skip to contentSkip to conversation

ref-manual: Update how to set a useradd password

PATCH Daiane Angolini 2 participants 3 messages Oct 20, 2021 – Oct 21, 2021 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive

Hi

I am not completely sure of some details on this patch. Any suggestions to make it better, please let me know.

There is a bug [1] and the commit which changed this behavior is [2]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14605
[2] http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/shadow?id=759df7395908f18b3b68f28d043ac9ebd42dd0c8

Regards,
Daiane

Quoted 55 lines · Daiane Angolini via lists.yoctoproject.org

Partial fix for [YOCTO 14605]

---
 documentation/ref-manual/classes.rst | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
documentation/ref-manual/classes.rst +11 -6
index ffaad9bfc..b09f83b28 100644
@@ -590,19 +590,25 @@ Here is an example that uses this class in an image recipe::
        "
 
 Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
-passwords::
+passwords. First on host, create the password hash::
+
+   mkpasswd -m sha512crypt tester01
+
+The resultant hash is set to a variable and used in ``useradd`` command parameters.
+Remember to escape the character ``$``::
 
    inherit extrausers
+   PASSWD = "\$6\$kt.uxYMp9O9.Yxqd\$SBaJTucixmPm7/WjFL2CjUGMHTqtw8KPK0yxpYw.tGWWHlnOwkUwZ0Pa6vR724Te/E5./V.wua4HT/h0li8Lw/"
    EXTRA_USERS_PARAMS = "\
-       useradd -P tester01 tester-jim; \
-       useradd -P tester01 tester-sue; \
+       useradd -p '${PASSWD} tester-jim; \
+       useradd -p '${PASSWD} tester-sue; \
        "
 
-Finally, here is an example that sets the root password to "1876*18"::
+Finally, here is an example that sets the root password::
 
    inherit extrausers
    EXTRA_USERS_PARAMS = "\
-       usermod -P 1876*18 root; \
+       usermod -p '${PASSWD} root; \
        "
 
 .. _ref-classes-features_check:
--

2.30.2

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#2014): https://lists.yoctoproject.org/g/docs/message/2014
Mute This Topic: https://lists.yoctoproject.org/mt/86470322/5992125
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/docs/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw

Oi Daiane

Many thanks for the patch!

Quoted 9 lines · Daiane Angolini

Hi

I am not completely sure of some details on this patch. Any suggestions to make it better, please let me know.

There is a bug [1] and the commit which changed this behavior is [2]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14605
[2] http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/shadow?id=759df7395908f18b3b68f28d043ac9ebd42dd0c8

Your patch looks perfectly good to me. I'm currently testing it. Why do you say that it only partially fixes [YOCTO 14605]?

Thanks again,
Michael.

Signature · 3 lines
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
#3 lore raw
Quoted 3 lines · Michael Opdenacker

Oi Daiane

Hi Michael

Quoted 8 lines

Many thanks for the patch!

Quoted 5 lines · Daiane Angolini

Hi

I am not completely sure of some details on this patch. Any suggestions to make it better, please let me know.

Quoted 8 lines
Quoted 4 lines

There is a bug [1] and the commit which changed this behavior is [2]

[1] https://bugzilla.yoctoproject.org/show_bug.cgi?id=14605
[2] http://cgit.openembedded.org/openembedded-core/commit/meta/recipes-extended/shadow?id=759df7395908f18b3b68f28d043ac9ebd42dd0c8

Your patch looks perfectly good to me. I'm currently testing it. Why do you say that it only partially fixes [YOCTO 14605]?

Because I think something is also needed from the oe-core perspective. Something like this:
https://lists.openembedded.org/g/openembedded-core/message/157090

But I'm still working on it

Thanks for reviewing and testing the patch.

Daiane

Quoted 9 lines

Thanks again,
Michael.

--
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com