shadow: move /etc/default/useradd creation to "Configuration"

This is needed so that /etc/default/useradd is not removed by package
managers when rebuilding shadow in BLFS. Change the explanations in
the text accordingly.
This commit is contained in:
Pierre Labastie 2022-01-04 12:34:59 +01:00
parent d21ec2fcbb
commit 7f13657de1

View File

@ -143,9 +143,7 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></s
<para>Install the package:</para> <para>Install the package:</para>
<screen><userinput remap="install">make exec_prefix=/usr install <screen><userinput remap="install">make exec_prefix=/usr install
make -C man install-man make -C man install-man</userinput></screen>
mkdir -p /etc/default
useradd -D --gid 999</userinput></screen>
</sect2> </sect2>
@ -174,23 +172,30 @@ useradd -D --gid 999</userinput></screen>
<screen><userinput>grpconv</userinput></screen> <screen><userinput>grpconv</userinput></screen>
<para>Shadow's stock configuration for the <command>useradd</command> <para>Shadow's default configuration for the <command>useradd</command>
utility has a few caveats that need some explanation. First, the default utility has a few caveats that need some explanation. First, the default
action for the <command>useradd</command> utility is to create the user and action for the <command>useradd</command> utility is to create the user and
a group of the same name as the user. By default the user ID (UID) and a group of the same name as the user. By default the user ID (UID) and
group ID (GID) numbers will begin with 1000. This means if you don't pass group ID (GID) numbers will begin with 1000. This means if you don't pass
parameters to <command>useradd</command>, each user will be a member of a parameters to <command>useradd</command>, each user will be a member of a
unique group on the system. If this behavior is undesirable, you'll need unique group on the system. If this behavior is undesirable, you'll need
to pass the <parameter>-g</parameter> parameter to to pass one of the <parameter>-g</parameter> or <parameter>-N</parameter>
<command>useradd</command>. The default parameters are stored in the parameter to <command>useradd</command> or to change the setting of
<filename>/etc/default/useradd</filename> file. You may need to modify two <parameter>USERGROUPS_ENAB</parameter> in
parameters in this file to suit your particular needs.</para> <filename>/etc/login.defs</filename>. See <filename>useradd(8)</filename>
for more information.</para>
<para>Second, to change the default parameters, the file
<filename>/etc/default/useradd</filename> needs to be created and taylored
to suit your particular needs. Create it with:</para>
<screen><userinput>mkdir -p /etc/default
useradd -D --gid 999</userinput></screen>
<variablelist> <variablelist>
<title><filename>/etc/default/useradd</filename> Parameter Explanations</title> <title><filename>/etc/default/useradd</filename> Parameter Explanations</title>
<varlistentry> <varlistentry>
<term><parameter>GROUP=1000</parameter></term> <term><parameter>GROUP=999</parameter></term>
<listitem> <listitem>
<para>This parameter sets the beginning of the group numbers used in <para>This parameter sets the beginning of the group numbers used in
the /etc/group file. You can modify it to anything you desire. Note the /etc/group file. You can modify it to anything you desire. Note
@ -215,13 +220,12 @@ useradd -D --gid 999</userinput></screen>
created by <command>useradd</command>, issue the following created by <command>useradd</command>, issue the following
command:</para> command:</para>
<screen><userinput>sed -i 's/yes/no/' /etc/default/useradd</userinput></screen> <screen><userinput>sed -i '/MAIL/s/yes/no/' /etc/default/useradd</userinput></screen>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
</sect2> </sect2>
<sect2 role="configuration"> <sect2 role="configuration">