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>
This commit is contained in:
Daiane Angolini 2021-10-22 11:16:32 -03:00 committed by Richard Purdie
parent 14d4106f56
commit 1b1369d52c

View File

@ -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 sha256crypt tester01
The resulting hash is set to a variable and used in ``useradd`` command parameters.
Remember to escape the character ``$``::
inherit extrausers
PASSWD = "\$X\$ABC123\$A-Long-Hash"
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: