aboutsummaryrefslogtreecommitdiffstats
path: root/chapter06/shadowpwd-inst.xml
blob: ba30a1a46661b8020ceb1b9f31f58ca10d9345da (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>

<sect2>
<title>Installation of Shadow Password Suite</title>

<para>Before you install this package, you may want to have a look at
the Shadow hint. It discusses how you can make your system more secure
regarding passwords, such as how to enable the more secure MD5 passwords
and how to get the most out of this Shadow package. The Shadow hint can
be found at <ulink url="&hints-root;shadowpasswd_plus.txt"/>.</para>

<para>Programs like login, shutdown, uptime, and others want to read
from and to the /var/run/utmp, /var/log/btmp and /var/log/wtmp. These
files contain information about who is currently logged in. They also
contain information about when the conmputer was last booted and
shutdown and a record of bas login attempts.</para>

<para>Create these files with their proper permissions by running the
following commands:</para>

<para><screen><userinput>touch /var/run/utmp /var/log/{btmp,lastlog,wtmp} &amp;&amp;
chmod 644 /var/run/utmp /var/log/{btmp,lastlog,wtmp}</userinput></screen></para>

<para>Shadow hard-codes the path to the passwd binary within itself, but
it does it the wrong way. If no passwd binary is present before
installing Shadow, it (wrongly) assumes that it will be at /bin/passwd,
but then installs its own in /usr/bin/passwd. This will lead to strange
errors about not finding /bin/passwd. To fix workaround this bug in
Shadow, we'll create a dummy passwd file so that it gets hardcoded in
the right place:</para>

<para><screen><userinput>touch /usr/bin/passwd</userinput></screen></para>

<para>Prepare Shadow to be compiled:</para>

<para><screen><userinput>./configure --prefix=/usr --libdir=/usr/lib \
&nbsp;&nbsp;&nbsp;&nbsp;--enable-shared</userinput></screen></para>

<para>Continue with compiling the package:</para>

<para><screen><userinput>make</userinput></screen></para>

<para>Install the package:</para>

<para><screen><userinput>make install</userinput></screen></para>

<para>Shadow uses two files to configure authentication settings for
the system. Install those config files:</para>

<para><screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen></para>

<para><filename class="directory">/var/spool/mail</filename> is the
old location of the user mailboxes. The location that is used nowadays
is /var/mail. Issue the following command to modify the mailbox
location:</para>

<para><screen><userinput>sed 's%/var/spool/mail%/var/mail%' \
&nbsp;&nbsp;&nbsp;&nbsp;etc/login.defs.linux &gt; /etc/login.defs</userinput></screen></para>

<para>According to the manpage of <userinput>vipw</userinput>,
a <userinput>vigr</userinput> symlink should exist. Because the
shadow installation procedure doesn't create this symlink, it
must be created manually:</para>

<para><screen><userinput>ln -s vipw /usr/sbin/vigr</userinput></screen></para>

<para>The <filename>vipw</filename> link is currently pointing
to a non-existing file. Since this file isn't needed here, remove
it:</para>

<para><screen><userinput>rm /bin/vipw</userinput></screen></para>

<para>Move the <userinput>sg</userinput> program to the
<filename class="directory">/usr/bin</filename> directory:</para>

<para><screen><userinput>mv /bin/sg /usr/bin</userinput></screen></para>

<para>Move Shadow's dynamic libraries to a more appropriate location:</para>

<para><screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen></para>

<para>The libraries have been moved, but some packages expect to
find them in them in the
<filename class="directory">/usr/lib</filename> directory. To account
for this, create the following symlinks:</para>

<para><screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so &amp;&amp;
ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen></para>

<para>Sh-utils and Shadow Password Suite each install a unique
<filename>groups</filename> program. If you wish, you may remove the
<filename>groups</filename> program installed by the Shadow Password
Suite:</para>

<para><screen><userinput>rm /bin/groups</userinput></screen></para>

</sect2>