All of lore.kernel.org
 help / color / mirror / Atom feed
* [docs v3] ref-manual: Update how to set a useradd password
@ 2021-10-22 14:16 Daiane Angolini
  2021-10-22 14:44 ` [docs] " Michael Opdenacker
  0 siblings, 1 reply; 2+ messages in thread
From: Daiane Angolini @ 2021-10-22 14:16 UTC (permalink / raw)
  To: docs; +Cc: Daiane Angolini

Partial fix for [YOCTO 14605]

Signed-off-by: Daiane Angolini <daiane.angolini@foundries.io>
---
changes since v2:
- replace the content of PASSWD variable in the example

 documentation/ref-manual/classes.rst | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
index 79af45ada..9b1ead66b 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::
        "
 
 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:
-- 
2.30.2



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [docs] [docs v3] ref-manual: Update how to set a useradd password
  2021-10-22 14:16 [docs v3] ref-manual: Update how to set a useradd password Daiane Angolini
@ 2021-10-22 14:44 ` Michael Opdenacker
  0 siblings, 0 replies; 2+ messages in thread
From: Michael Opdenacker @ 2021-10-22 14:44 UTC (permalink / raw)
  To: Daiane Angolini, docs

Hi Daiane,

On 10/22/21 4:16 PM, Daiane Angolini wrote:
> Partial fix for [YOCTO 14605]
>
> Signed-off-by: Daiane Angolini <daiane.angolini@foundries.io>
> ---
> changes since v2:
> - replace the content of PASSWD variable in the example
>
>  documentation/ref-manual/classes.rst | 16 +++++++++++-----
>  1 file changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst
> index 79af45ada..9b1ead66b 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::
>         "
>  
>  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:


Everything looks good to me. Thank you for the update!
Reviewed-by: Michael Opdenacker <michael.opdenacker@bootlin.com>

... and merged into "master-next" and "honister-next".

Cheers
Michael.

-- 
Michael Opdenacker, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-22 14:44 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-22 14:16 [docs v3] ref-manual: Update how to set a useradd password Daiane Angolini
2021-10-22 14:44 ` [docs] " Michael Opdenacker

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.