summaryrefslogtreecommitdiffstats
path: root/documentation
diff options
context:
space:
mode:
authorDaiane Angolini <daiane.angolini@foundries.io>2021-10-22 11:16:32 -0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-22 22:15:30 +0100
commit1b1369d52c2a175e192802556cb63f2bf60dfb55 (patch)
treecf760809d450f85f525a9574cbd075e68dd09949 /documentation
parent14d4106f566f30742109aa60fd2cfc3e11f22f37 (diff)
downloadpoky-1b1369d52c2a175e192802556cb63f2bf60dfb55.tar.gz
ref-manual: Update how to set a useradd password
Partial fix for [YOCTO 14605] (From yocto-docs rev: d9c7fba68ca7c901e9e7064fee2989d834d4684c) Signed-off-by: Daiane Angolini <daiane.angolini@foundries.io> Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'documentation')
-rw-r--r--documentation/ref-manual/classes.rst16
1 files changed, 11 insertions, 5 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 381c5d1dd7..694e20ebc3 100644
--- a/documentation/ref-manual/classes.rst
+++ b/documentation/ref-manual/classes.rst
@@ -590,19 +590,25 @@ Here is an example that uses this class in an image recipe::
590 " 590 "
591 591
592Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns 592Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns
593passwords:: 593passwords. First on host, create the password hash::
594
595 mkpasswd -m sha256crypt tester01
596
597The resulting hash is set to a variable and used in ``useradd`` command parameters.
598Remember to escape the character ``$``::
594 599
595 inherit extrausers 600 inherit extrausers
601 PASSWD = "\$X\$ABC123\$A-Long-Hash"
596 EXTRA_USERS_PARAMS = "\ 602 EXTRA_USERS_PARAMS = "\
597 useradd -P tester01 tester-jim; \ 603 useradd -p '${PASSWD}' tester-jim; \
598 useradd -P tester01 tester-sue; \ 604 useradd -p '${PASSWD}' tester-sue; \
599 " 605 "
600 606
601Finally, here is an example that sets the root password to "1876*18":: 607Finally, here is an example that sets the root password::
602 608
603 inherit extrausers 609 inherit extrausers
604 EXTRA_USERS_PARAMS = "\ 610 EXTRA_USERS_PARAMS = "\
605 usermod -P 1876*18 root; \ 611 usermod -p '${PASSWD}' root; \
606 " 612 "
607 613
608.. _ref-classes-features_check: 614.. _ref-classes-features_check: