diff --git a/chapter08/shadow.xml b/chapter08/shadow.xml
index b7b77d16b..ea540d1cf 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,34 +172,48 @@ 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
/etc/default/useradd 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
- that useradd will never reuse a UID or GID. If the
- number identified in this parameter is used, it will use the next
- available number after this. Note also that if you don't have a group
- 1000 on your system the first time you use useradd
- without the -g parameter, you'll get a message
- displayed on the terminal that says:
- useradd: unknown GID 1000. You may
- disregard this message and group number 1000 will be used.
+ the /etc/group file. The particular value 999
+ comes from the --gid parameter above. You can
+ modify it to anything you desire.
+
+ Note that useradd will never reuse a UID or GID.
+ If the number identified in this parameter is used, it will use the
+ next available number. Note also that if you don't have a group with
+ an ID equal to this number on your system the first time you use
+ useradd without the -g
+ parameter, you will get a message displayed on the terminal that
+ says: useradd: unknown GID 999,
+ although the account is correctly created. That is why we have
+ created the group users
+ with this group ID in .
+
@@ -215,13 +227,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
-