1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 | ]>
|
---|
7 |
|
---|
8 | <sect1 id="shadow">
|
---|
9 | <?dbhtml filename="shadow.html"?>
|
---|
10 | <title>Shadow-&shadow-version;</title>
|
---|
11 |
|
---|
12 | <!--
|
---|
13 | <sect2>
|
---|
14 | <title>Configuring shadow</title>
|
---|
15 |
|
---|
16 | <para>Shadow's Configuration File</para>
|
---|
17 |
|
---|
18 | <para><userinput>/etc/login.defs</userinput></para>
|
---|
19 |
|
---|
20 | <para>Enabling <acronym>MD</acronym>5 Passwords</para>
|
---|
21 |
|
---|
22 | <para>To enable <acronym>MD</acronym>5 Passwords, modify the line in the
|
---|
23 | <filename>login.defs</filename> file that reads:
|
---|
24 | <screen><userinput>#MD5_CRYPT_ENAB no</userinput></screen>
|
---|
25 | to read:
|
---|
26 | <screen><userinput>MD5_CRYPT_ENAB yes</userinput></screen>
|
---|
27 | Passwords created after this change will be encrypted using
|
---|
28 | <acronym>MD</acronym>5 (Message-Digest Algorithm) instead of using
|
---|
29 | <acronym>DES</acronym> encryption.
|
---|
30 | </para>
|
---|
31 | </sect2>
|
---|
32 | -->
|
---|
33 |
|
---|
34 | <sect2>
|
---|
35 | <title>Introduction to <application>Shadow</application></title>
|
---|
36 |
|
---|
37 | <para>Shadow was indeed installed in <acronym>LFS</acronym> and there is
|
---|
38 | no reason to reinstall it unless you installed
|
---|
39 | <application>Linux-<acronym>PAM</acronym></application>. If you did,
|
---|
40 | this will allow programs like <command>login</command> and
|
---|
41 | <command>su</command> to utilize
|
---|
42 | <acronym>PAM</acronym>.</para>
|
---|
43 |
|
---|
44 | <sect3><title>Additional downloads</title>
|
---|
45 | <itemizedlist spacing='compact'>
|
---|
46 | <listitem><para>Patch to fix linking against PAM:
|
---|
47 | <ulink url="&patch-root;/shadow-&shadow-version;-pam-1.patch"/></para></listitem>
|
---|
48 | </itemizedlist>
|
---|
49 | </sect3>
|
---|
50 |
|
---|
51 | <sect3><title><application>Shadow</application> dependencies</title>
|
---|
52 | <sect4><title>Required</title>
|
---|
53 | <para><xref linkend="Linux_PAM"/></para></sect4>
|
---|
54 | </sect3>
|
---|
55 | </sect2>
|
---|
56 |
|
---|
57 | <sect2>
|
---|
58 | <title>Installation of <application>Shadow</application></title>
|
---|
59 |
|
---|
60 | <para>Reinstall <application>Shadow</application> by running the following
|
---|
61 | commands:</para>
|
---|
62 |
|
---|
63 | <screen><userinput><command>patch -Np1 -i ../shadow-&shadow-version;-pam-1.patch &&
|
---|
64 | LIBS="-lpam -lpam_misc" ./configure --libdir=/usr/lib \
|
---|
65 | --enable-shared --with-libpam --without-libcrack &&
|
---|
66 | echo '#define HAVE_SETLOCALE 1' >> config.h &&
|
---|
67 | make &&
|
---|
68 | make install &&
|
---|
69 | mv /bin/sg /usr/bin &&
|
---|
70 | mv /bin/vigr /usr/sbin &&
|
---|
71 | rm /bin/groups &&
|
---|
72 | mv /usr/lib/lib{misc,shadow}.so.0* /lib &&
|
---|
73 | ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so &&
|
---|
74 | ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</command></userinput></screen>
|
---|
75 |
|
---|
76 | </sect2>
|
---|
77 |
|
---|
78 | <sect2>
|
---|
79 | <title>Command explanations</title>
|
---|
80 |
|
---|
81 | <para><parameter>--without-libcrack</parameter>: This switch tells
|
---|
82 | <application>Shadow</application> not to use
|
---|
83 | <filename class='libraryfile'>libcrack</filename>. This is desired as
|
---|
84 | <application>Linux-<acronym>PAM</acronym></application> already contains
|
---|
85 | <filename class='libraryfile'>libcrack</filename>.</para>
|
---|
86 |
|
---|
87 | <!-- Leftover from older instructions????
|
---|
88 | <para><command>cp debian/securetty /etc/securetty</command>: This
|
---|
89 | command sets the tty's that allow logins through <acronym>PAM</acronym>.</para>
|
---|
90 | -->
|
---|
91 |
|
---|
92 | </sect2>
|
---|
93 |
|
---|
94 | <sect2>
|
---|
95 | <title>Configuring <application>Linux-<acronym>PAM</acronym></application> to work
|
---|
96 | with <application>Shadow</application></title>
|
---|
97 |
|
---|
98 | <sect3><title>Config files</title>
|
---|
99 | <para><filename>/etc/pam.d/login</filename>,
|
---|
100 | <filename>/etc/pam.d/passwd</filename>,
|
---|
101 | <filename>/etc/pam.d/su</filename>,
|
---|
102 | <filename>/etc/pam.d/shadow</filename>,
|
---|
103 | <filename>/etc/pam.d/useradd</filename>, and
|
---|
104 | <filename>/etc/pam.d/chage</filename> –
|
---|
105 | alternatively, <filename>/etc/pam.conf</filename></para>
|
---|
106 | </sect3>
|
---|
107 |
|
---|
108 | <sect3><title>Configuration Information</title>
|
---|
109 |
|
---|
110 | <para>Add the following <application>Linux-<acronym>PAM</acronym></application>
|
---|
111 | configuration files to <filename class="directory">/etc/pam.d/</filename> (or
|
---|
112 | add them to <filename>/etc/pam.conf</filename> with the additional field for
|
---|
113 | the program).</para>
|
---|
114 |
|
---|
115 | <screen><userinput><command>cat > /etc/pam.d/login << "EOF"</command>
|
---|
116 | # Begin /etc/pam.d/login
|
---|
117 |
|
---|
118 | auth requisite pam_securetty.so
|
---|
119 | auth requisite pam_nologin.so
|
---|
120 | auth required pam_env.so
|
---|
121 | auth required pam_unix.so
|
---|
122 | account required pam_access.so
|
---|
123 | account required pam_unix.so
|
---|
124 | session required pam_motd.so
|
---|
125 | session required pam_limits.so
|
---|
126 | session optional pam_mail.so dir=/var/mail standard
|
---|
127 | session optional pam_lastlog.so
|
---|
128 | session required pam_unix.so
|
---|
129 |
|
---|
130 | # End /etc/pam.d/login
|
---|
131 | <command>EOF
|
---|
132 | cat > /etc/pam.d/passwd << "EOF"</command>
|
---|
133 | # Begin /etc/pam.d/passwd
|
---|
134 |
|
---|
135 | password required pam_unix.so md5 shadow
|
---|
136 |
|
---|
137 | # End /etc/pam.d/passwd
|
---|
138 | <command>EOF
|
---|
139 | cat > /etc/pam.d/shadow << "EOF"</command>
|
---|
140 | # Begin /etc/pam.d/shadow
|
---|
141 |
|
---|
142 | auth sufficient pam_rootok.so
|
---|
143 | auth required pam_unix.so
|
---|
144 | account required pam_unix.so
|
---|
145 | session required pam_unix.so
|
---|
146 | password required pam_permit.so
|
---|
147 |
|
---|
148 | # End /etc/pam.d/shadow
|
---|
149 | <command>EOF
|
---|
150 | cat > /etc/pam.d/su << "EOF"</command>
|
---|
151 | # Begin /etc/pam.d/su
|
---|
152 |
|
---|
153 | auth sufficient pam_rootok.so
|
---|
154 | auth required pam_unix.so
|
---|
155 | account required pam_unix.so
|
---|
156 | session required pam_unix.so
|
---|
157 |
|
---|
158 | # End /etc/pam.d/su
|
---|
159 | <command>EOF
|
---|
160 | cat > /etc/pam.d/useradd << "EOF"</command>
|
---|
161 | # Begin /etc/pam.d/useradd
|
---|
162 |
|
---|
163 | auth sufficient pam_rootok.so
|
---|
164 | auth required pam_unix.so
|
---|
165 | account required pam_unix.so
|
---|
166 | session required pam_unix.so
|
---|
167 | password required pam_permit.so
|
---|
168 |
|
---|
169 | # End /etc/pam.d/useradd
|
---|
170 | <command>EOF
|
---|
171 | cat > /etc/pam.d/chage << "EOF"</command>
|
---|
172 | # Begin /etc/pam.d/chage
|
---|
173 |
|
---|
174 | auth sufficient pam_rootok.so
|
---|
175 | auth required pam_unix.so
|
---|
176 | account required pam_unix.so
|
---|
177 | session required pam_unix.so
|
---|
178 | password required pam_permit.so
|
---|
179 |
|
---|
180 | # End /etc/pam.d/chage
|
---|
181 | <command>EOF</command></userinput></screen>
|
---|
182 |
|
---|
183 | <para>Currently, <filename>/etc/pam.d/other</filename> is configured to
|
---|
184 | allow anyone with an account on the machine to use programs
|
---|
185 | that do not specifically have a configuration file of their own. After
|
---|
186 | testing <application>Linux-<acronym>PAM</acronym></application> for proper
|
---|
187 | configuration, it can be changed to the following:</para>
|
---|
188 |
|
---|
189 | <screen><userinput><command>cat > /etc/pam.d/other << "EOF"</command>
|
---|
190 | # Begin /etc/pam.d/other
|
---|
191 |
|
---|
192 | auth required pam_deny.so
|
---|
193 | auth required pam_warn.so
|
---|
194 | account required pam_deny.so
|
---|
195 | session required pam_deny.so
|
---|
196 | password required pam_deny.so
|
---|
197 | password required pam_warn.so
|
---|
198 |
|
---|
199 | # End /etc/pam.d/other
|
---|
200 | <command>EOF</command></userinput></screen>
|
---|
201 |
|
---|
202 | <para>Finally, edit <filename>/etc/login.defs</filename> by adding '#'
|
---|
203 | to the beginning of the following lines:</para>
|
---|
204 | <screen>LASTLOG_ENAB
|
---|
205 | MAIL_CHECK_ENAB
|
---|
206 | PORTTIME_CHECKS_ENAB
|
---|
207 | CONSOLE
|
---|
208 | MOTD_FILE
|
---|
209 | NOLOGINS_FILE
|
---|
210 | PASS_MIN_LEN
|
---|
211 | SU_WHEEL_ONLY
|
---|
212 | MD5_CRYPT_ENAB
|
---|
213 | CONSOLE_GROUPS
|
---|
214 | ENVIRON_FILE</screen>
|
---|
215 |
|
---|
216 | <para>This stops <command>login</command> from performing these functions, as
|
---|
217 | they will now be performed by <acronym>PAM</acronym> modules.</para>
|
---|
218 |
|
---|
219 | </sect3>
|
---|
220 |
|
---|
221 | </sect2>
|
---|
222 |
|
---|
223 | </sect1>
|
---|