diff options
author | Daiane Angolini <daiane.angolini@foundries.io> | 2021-10-22 11:16:32 -0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2021-10-22 22:15:33 +0100 |
commit | 634b7f1fdce6eb4416ea3c23f09b09fb879d8334 (patch) | |
tree | a6b923c83aa46238f2068cbfe5853c8b62186dd4 /documentation/ref-manual | |
parent | fd6e9609d1e7f0be6f20eb7906a00d433329be03 (diff) | |
download | poky-634b7f1fdce6eb4416ea3c23f09b09fb879d8334.tar.gz |
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>
Diffstat (limited to 'documentation/ref-manual')
-rw-r--r-- | documentation/ref-manual/classes.rst | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index 79af45ada5..9b1ead66b3 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 | ||
592 | Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns | 592 | Here is an example that adds two users named "tester-jim" and "tester-sue" and assigns |
593 | passwords:: | 593 | passwords. First on host, create the password hash:: |
594 | |||
595 | mkpasswd -m sha256crypt tester01 | ||
596 | |||
597 | The resulting hash is set to a variable and used in ``useradd`` command parameters. | ||
598 | Remember 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 | ||
601 | Finally, here is an example that sets the root password to "1876*18":: | 607 | Finally, 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: |