diff options
author | Pierre Labastie <pierre.labastie@neuf.fr> | 2022-01-04 12:34:59 +0100 |
---|---|---|
committer | Pierre Labastie <pierre.labastie@neuf.fr> | 2022-01-04 12:38:18 +0100 |
commit | 7f13657de1ca21bcd94830df21a5b48efbd89e97 (patch) | |
tree | 3696845b0d72b7369b7ad760037f596fbb14672e /chapter08 | |
parent | d21ec2fcbb46ee07dc404a39b3bebba762a91a6b (diff) |
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.
Diffstat (limited to 'chapter08')
-rw-r--r-- | chapter08/shadow.xml | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml index b7b77d16b..b6587e0b1 100644 --- a/chapter08/shadow.xml +++ b/chapter08/shadow.xml @@ -143,9 +143,7 @@ find man -name Makefile.in -exec sed -i 's/passwd\.5 / /' {} \;</userinput></s <para>Install the package:</para> <screen><userinput remap="install">make exec_prefix=/usr install -make -C man install-man -mkdir -p /etc/default -useradd -D --gid 999</userinput></screen> +make -C man install-man</userinput></screen> </sect2> @@ -174,23 +172,30 @@ useradd -D --gid 999</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 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 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 unique group on the system. If this behavior is undesirable, you'll need - to pass the <parameter>-g</parameter> parameter to - <command>useradd</command>. The default parameters are stored in the - <filename>/etc/default/useradd</filename> file. You may need to modify two - parameters in this file to suit your particular needs.</para> + to pass one of the <parameter>-g</parameter> or <parameter>-N</parameter> + parameter to <command>useradd</command> or to change the setting of + <parameter>USERGROUPS_ENAB</parameter> in + <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> <title><filename>/etc/default/useradd</filename> Parameter Explanations</title> <varlistentry> - <term><parameter>GROUP=1000</parameter></term> + <term><parameter>GROUP=999</parameter></term> <listitem> <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 @@ -215,13 +220,12 @@ useradd -D --gid 999</userinput></screen> created by <command>useradd</command>, issue the following 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> </varlistentry> </variablelist> - </sect2> <sect2 role="configuration"> |