source: postlfs/security/shadow.xml@ 8abd5653

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since 8abd5653 was 2197589, checked in by Randy McMurchy <randy@…>, 20 years ago

Updated to iptables-1.2.11; added missing tags in various package instructions

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@2403 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 7.0 KB
Line 
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>
25to read:
26<screen><userinput>MD5_CRYPT_ENAB yes</userinput></screen>
27Passwords 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
38no reason to reinstall it unless you installed
39<application>Linux-<acronym>PAM</acronym></application>. If you did,
40this 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
61commands:</para>
62
63<screen><userinput><command>patch -Np1 -i ../shadow-&shadow-version;-pam-1.patch &amp;&amp;
64LIBS="-lpam -lpam_misc" ./configure --libdir=/usr/lib \
65 --enable-shared --with-libpam --without-libcrack &amp;&amp;
66echo '#define HAVE_SETLOCALE 1' >> config.h &amp;&amp;
67make &amp;&amp;
68make install &amp;&amp;
69mv /bin/sg /usr/bin &amp;&amp;
70mv /bin/vigr /usr/sbin &amp;&amp;
71rm /bin/groups &amp;&amp;
72mv /usr/lib/lib{misc,shadow}.so.0* /lib &amp;&amp;
73ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so &amp;&amp;
74ln -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
89command 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
96with <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> &ndash;
105alternatively, <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>
111configuration files to <filename class="directory">/etc/pam.d/</filename> (or
112add them to <filename>/etc/pam.conf</filename> with the additional field for
113the program).</para>
114
115<screen><userinput><command>cat &gt; /etc/pam.d/login &lt;&lt; "EOF"</command>
116# Begin /etc/pam.d/login
117
118auth requisite pam_securetty.so
119auth requisite pam_nologin.so
120auth required pam_env.so
121auth required pam_unix.so
122account required pam_access.so
123account required pam_unix.so
124session required pam_motd.so
125session required pam_limits.so
126session optional pam_mail.so dir=/var/mail standard
127session optional pam_lastlog.so
128session required pam_unix.so
129
130# End /etc/pam.d/login
131<command>EOF
132cat &gt; /etc/pam.d/passwd &lt;&lt; "EOF"</command>
133# Begin /etc/pam.d/passwd
134
135password required pam_unix.so md5 shadow
136
137# End /etc/pam.d/passwd
138<command>EOF
139cat &gt; /etc/pam.d/shadow &lt;&lt; "EOF"</command>
140# Begin /etc/pam.d/shadow
141
142auth sufficient pam_rootok.so
143auth required pam_unix.so
144account required pam_unix.so
145session required pam_unix.so
146password required pam_permit.so
147
148# End /etc/pam.d/shadow
149<command>EOF
150cat &gt; /etc/pam.d/su &lt;&lt; "EOF"</command>
151# Begin /etc/pam.d/su
152
153auth sufficient pam_rootok.so
154auth required pam_unix.so
155account required pam_unix.so
156session required pam_unix.so
157
158# End /etc/pam.d/su
159<command>EOF
160cat &gt; /etc/pam.d/useradd &lt;&lt; "EOF"</command>
161# Begin /etc/pam.d/useradd
162
163auth sufficient pam_rootok.so
164auth required pam_unix.so
165account required pam_unix.so
166session required pam_unix.so
167password required pam_permit.so
168
169# End /etc/pam.d/useradd
170<command>EOF
171cat &gt; /etc/pam.d/chage &lt;&lt; "EOF"</command>
172# Begin /etc/pam.d/chage
173
174auth sufficient pam_rootok.so
175auth required pam_unix.so
176account required pam_unix.so
177session required pam_unix.so
178password 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
184allow anyone with an account on the machine to use programs
185that do not specifically have a configuration file of their own. After
186testing <application>Linux-<acronym>PAM</acronym></application> for proper
187configuration, it can be changed to the following:</para>
188
189<screen><userinput><command>cat &gt; /etc/pam.d/other &lt;&lt; "EOF"</command>
190# Begin /etc/pam.d/other
191
192auth required pam_deny.so
193auth required pam_warn.so
194account required pam_deny.so
195session required pam_deny.so
196password required pam_deny.so
197password 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 '#'
203to the beginning of the following lines:</para>
204<screen>LASTLOG_ENAB
205MAIL_CHECK_ENAB
206PORTTIME_CHECKS_ENAB
207CONSOLE
208MOTD_FILE
209NOLOGINS_FILE
210PASS_MIN_LEN
211SU_WHEEL_ONLY
212MD5_CRYPT_ENAB
213CONSOLE_GROUPS
214ENVIRON_FILE</screen>
215
216<para>This stops <command>login</command> from performing these functions, as
217they will now be performed by <acronym>PAM</acronym> modules.</para>
218
219</sect3>
220
221</sect2>
222
223</sect1>
Note: See TracBrowser for help on using the repository browser.