source: chapter06/shadow.xml@ 2a264e0b

10.0 10.0-rc1 10.1 10.1-rc1 11.0 11.0-rc1 11.0-rc2 11.0-rc3 11.1 11.1-rc1 11.2 11.2-rc1 11.3 11.3-rc1 12.0 12.0-rc1 12.1 12.1-rc1 6.0 6.1 6.1.1 6.3 6.4 6.5 6.6 6.7 6.8 7.0 7.1 7.2 7.3 7.4 7.5 7.5-systemd 7.6 7.6-systemd 7.7 7.7-systemd 7.8 7.8-systemd 7.9 7.9-systemd 8.0 8.1 8.2 8.3 8.4 9.0 9.1 arm bdubbs/gcc13 ml-11.0 multilib renodr/libudev-from-systemd s6-init trunk v5_1 v5_1_1 xry111/arm64 xry111/arm64-12.0 xry111/clfs-ng xry111/lfs-next xry111/loongarch xry111/loongarch-12.0 xry111/loongarch-12.1 xry111/mips64el xry111/pip3 xry111/rust-wip-20221008 xry111/update-glibc
Last change on this file since 2a264e0b was cd0c92d6, checked in by Alex Gronenwoud <alex@…>, 20 years ago

Adding a touch of mtab before the running of Coreutils test suite.

git-svn-id: http://svn.linuxfromscratch.org/LFS/trunk/BOOK@3257 4aa44e1e-78dd-0310-a6d2-fbcd4c07a689

  • Property mode set to 100644
File size: 5.0 KB
Line 
1<sect1 id="ch-system-shadow" xreflabel="Shadow">
2<title>Installing Shadow-&shadow-version;</title>
3<?dbhtml filename="shadow.html" dir="chapter06"?>
4
5<para>The Shadow package contains programs for handling passwords in a secure
6way.</para>
7
8<screen>&buildtime; &shadow-time;
9&diskspace; &shadow-compsize;</screen>
10
11&aa-shadow-down;
12&aa-shadow-dep;
13
14<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
15
16<sect2>
17<title>Installation of Shadow</title>
18
19<para>Shadow hard-wires the path to the <command>passwd</command> binary within
20the binary itself, but does this the wrong way. If a <command>passwd</command>
21binary is not present before installing Shadow, the package incorrectly assumes
22it is going to be located at <filename>/bin/passwd</filename>, but then
23installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
24about not finding <filename>/bin/passwd</filename>. To work around this bug,
25create a dummy <filename>passwd</filename> file, so that it gets hard-wired
26properly:</para>
27
28<screen><userinput>touch /usr/bin/passwd</userinput></screen>
29
30<para>Now prepare Shadow for compilation:</para>
31
32<screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
33
34<para>Work around a problem that prevents Shadow's internationalization from
35working:</para>
36
37<screen><userinput>echo '#define HAVE_SETLOCALE 1' &gt;&gt; config.h</userinput></screen>
38
39<para>Compile the package:</para>
40
41<screen><userinput>make</userinput></screen>
42
43<para>And install it:</para>
44
45<screen><userinput>make install</userinput></screen>
46
47<para>Shadow uses two files to configure authentication settings for the
48system. Install these two config files:</para>
49
50<screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
51
52<para>Instead of using the default <emphasis>crypt</emphasis> method, we want
53to use the more secure <emphasis>MD5</emphasis> method of password encryption,
54which in addition allows passwords longer than 8 characters. We also need to
55change the obsolete <filename class="directory">/var/spool/mail</filename>
56location for user mailboxes that Shadow uses by default to the <filename
57class="directory">/var/mail</filename> location used nowadays. We accomplish
58both these things by changing the relevant configuration file while copying it
59to its destination (it's probably better to cut-and-paste this rather than try
60and type it all in):</para>
61
62<screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
63&nbsp;&nbsp;&nbsp;&nbsp;-e 's%/var/spool/mail%/var/mail%' \
64&nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen>
65
66<para>Move some misplaced symlinks to their proper locations:</para>
67
68<screen><userinput>mv /bin/sg /usr/bin
69mv /bin/vigr /usr/sbin</userinput></screen>
70
71<para>And move Shadow's dynamic libraries to a more appropriate location:</para>
72
73<screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
74
75<para>As some packages expect to find the just-moved libraries in
76<filename>/usr/lib</filename>, create the following symlinks:</para>
77
78<screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
79ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
80
81<para>The -D option of the <filename>useradd</filename> program requires this
82directory for it to work properly:</para>
83
84<screen><userinput>mkdir /etc/default</userinput></screen>
85
86<para>Coreutils has already installed a better <command>groups</command>
87program in <filename class="directory">/usr/bin</filename>. Remove the one
88installed by Shadow:</para>
89
90<screen><userinput>rm /bin/groups</userinput></screen>
91
92</sect2>
93
94<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
95
96<sect2><title>Configuring Shadow</title>
97
98<para>This package contains utilities to add, modify and delete users and
99groups, set and change their passwords, and other such administrative tasks.
100For a full explanation of what <emphasis>password shadowing</emphasis> means,
101see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
102There's one thing to keep in mind if you decide to use Shadow support: programs
103that need to verify passwords (display managers, ftp programs, pop3 daemons,
104and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
105need to be able to work with shadowed passwords.</para>
106
107<para>To enable shadowed passwords, run the following command:</para>
108
109<screen><userinput>pwconv</userinput></screen>
110
111<para>And to enable shadowed group passwords, run:</para>
112
113<screen><userinput>grpconv</userinput></screen>
114
115<para>Under normal circumstances, you won't have created any passwords yet.
116However, if returning to this section later to enable shadowing, you should
117reset any current user passwords with the <command>passwd</command> command or
118any group passwords with the <command>gpasswd</command> command.</para>
119
120</sect2>
121
122<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
123
124<sect2>
125<title>Setting the root password</title>
126
127<para>Choose a password for user root and set it via:</para>
128
129<screen><userinput>passwd root</userinput></screen>
130
131</sect2>
132
133&aa-shadow-shortdesc;
134&aa-shadow-desc;
135
136</sect1>
137
Note: See TracBrowser for help on using the repository browser.