mirror of
https://git.yoctoproject.org/poky
synced 2026-06-02 01:19:52 +00:00
ref-manual: Update how to set a useradd password
Partial fix for [YOCTO 14605] (From yocto-docs rev: 3f3e5574ac9801ad92940168b61b532e0bd53a80) 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:
committed by
Richard Purdie
parent
fd6e9609d1
commit
634b7f1fdc
@@ -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
|
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
|
inherit extrausers
|
||||||
|
PASSWD = "\$X\$ABC123\$A-Long-Hash"
|
||||||
EXTRA_USERS_PARAMS = "\
|
EXTRA_USERS_PARAMS = "\
|
||||||
useradd -P tester01 tester-jim; \
|
useradd -p '${PASSWD}' tester-jim; \
|
||||||
useradd -P tester01 tester-sue; \
|
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
|
inherit extrausers
|
||||||
EXTRA_USERS_PARAMS = "\
|
EXTRA_USERS_PARAMS = "\
|
||||||
usermod -P 1876*18 root; \
|
usermod -p '${PASSWD}' root; \
|
||||||
"
|
"
|
||||||
|
|
||||||
.. _ref-classes-features_check:
|
.. _ref-classes-features_check:
|
||||||
|
|||||||
Reference in New Issue
Block a user