diff options
Diffstat (limited to 'documentation')
-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 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 | ||
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: |