From 7f13657de1ca21bcd94830df21a5b48efbd89e97 Mon Sep 17 00:00:00 2001 From: Pierre Labastie Date: Tue, 4 Jan 2022 12:34:59 +0100 Subject: 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. --- chapter08/shadow.xml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) (limited to 'chapter08') 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 / /' {} \;Install the package: make exec_prefix=/usr install -make -C man install-man -mkdir -p /etc/default -useradd -D --gid 999 +make -C man install-man @@ -174,23 +172,30 @@ useradd -D --gid 999 grpconv - Shadow's stock configuration for the useradd + Shadow's default configuration for the useradd utility has a few caveats that need some explanation. First, the default action for the useradd 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 useradd, each user will be a member of a unique group on the system. If this behavior is undesirable, you'll need - to pass the -g parameter to - useradd. The default parameters are stored in the - /etc/default/useradd file. You may need to modify two - parameters in this file to suit your particular needs. + to pass one of the -g or -N + parameter to useradd or to change the setting of + USERGROUPS_ENAB in + /etc/login.defs. See useradd(8) + for more information. + + Second, to change the default parameters, the file + /etc/default/useradd needs to be created and taylored + to suit your particular needs. Create it with: +mkdir -p /etc/default +useradd -D --gid 999 <filename>/etc/default/useradd</filename> Parameter Explanations - GROUP=1000 + GROUP=999 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 created by useradd, issue the following command: -sed -i 's/yes/no/' /etc/default/useradd +sed -i '/MAIL/s/yes/no/' /etc/default/useradd - -- cgit v1.2.3-54-g00ecf