[b4b71892] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[ff769b8c] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.4//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.4/docbookx.dtd" [
|
---|
[b4b71892] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[17fb537e] | 6 |
|
---|
[364bc5ba] | 7 | <!ENTITY shadow-download-http "http://ftp.pld.org.pl/software/shadow/old/shadow-&shadow-version;.tar.bz2">
|
---|
| 8 | <!ENTITY shadow-download-ftp "ftp://ftp.pld.org.pl/software/shadow/old/shadow-&shadow-version;.tar.bz2">
|
---|
[71e9f62] | 9 | <!ENTITY shadow-md5sum "bc5972a195290533b4c0576276056ed9">
|
---|
| 10 | <!ENTITY shadow-size "1.4 MB">
|
---|
| 11 | <!ENTITY shadow-buildsize "17 MB">
|
---|
[349b53dd] | 12 | <!ENTITY shadow-time "0.3 SBU">
|
---|
[b4b71892] | 13 | ]>
|
---|
| 14 |
|
---|
[17fb537e] | 15 | <sect1 id="shadow" xreflabel="Shadow-&shadow-version;">
|
---|
[322f172] | 16 | <?dbhtml filename="shadow.html"?>
|
---|
| 17 |
|
---|
| 18 | <sect1info>
|
---|
| 19 | <othername>$LastChangedBy$</othername>
|
---|
| 20 | <date>$Date$</date>
|
---|
| 21 | </sect1info>
|
---|
| 22 |
|
---|
| 23 | <title>Shadow-&shadow-version;</title>
|
---|
| 24 |
|
---|
| 25 | <indexterm zone="shadow">
|
---|
| 26 | <primary sortas="a-Shadow">Shadow</primary>
|
---|
| 27 | </indexterm>
|
---|
| 28 |
|
---|
| 29 | <sect2 role="package">
|
---|
| 30 | <title>Introduction to Shadow</title>
|
---|
| 31 |
|
---|
| 32 | <para><application>Shadow</application> was indeed installed in LFS and
|
---|
| 33 | there is no reason to reinstall it unless you installed
|
---|
[c6bdcb0] | 34 | <application>CrackLib</application> or
|
---|
| 35 | <application>Linux-PAM</application> after your LFS system was completed.
|
---|
| 36 | If you have installed <application>CrackLib</application> after LFS, then
|
---|
| 37 | reinstalling <application>Shadow</application> will enable strong password
|
---|
| 38 | support. If you have installed <application>Linux-PAM</application>,
|
---|
| 39 | reinstalling <application>Shadow</application> will allow programs such as
|
---|
[d8684cbc] | 40 | <command>login</command> and <command>su</command> to utilize PAM.</para>
|
---|
[322f172] | 41 |
|
---|
| 42 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 43 | <itemizedlist spacing="compact">
|
---|
| 44 | <listitem>
|
---|
| 45 | <para>Download (HTTP): <ulink url="&shadow-download-http;"/></para>
|
---|
| 46 | </listitem>
|
---|
| 47 | <listitem>
|
---|
| 48 | <para>Download (FTP): <ulink url="&shadow-download-ftp;"/></para>
|
---|
| 49 | </listitem>
|
---|
| 50 | <listitem>
|
---|
| 51 | <para>Download MD5 sum: &shadow-md5sum;</para>
|
---|
| 52 | </listitem>
|
---|
| 53 | <listitem>
|
---|
| 54 | <para>Download size: &shadow-size;</para>
|
---|
| 55 | </listitem>
|
---|
| 56 | <listitem>
|
---|
| 57 | <para>Estimated disk space required: &shadow-buildsize;</para>
|
---|
| 58 | </listitem>
|
---|
| 59 | <listitem>
|
---|
| 60 | <para>Estimated build time: &shadow-time;</para>
|
---|
| 61 | </listitem>
|
---|
| 62 | </itemizedlist>
|
---|
| 63 |
|
---|
[8f68b03] | 64 | <!--
|
---|
[322f172] | 65 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
| 66 | <itemizedlist spacing='compact'>
|
---|
| 67 | <listitem>
|
---|
[d8684cbc] | 68 | <para>Required patch: <ulink
|
---|
| 69 | url="&patch-root;/shadow-&shadow-version;-configure_fix-1.patch"/></para>
|
---|
[322f172] | 70 | </listitem>
|
---|
| 71 | </itemizedlist>
|
---|
[8f68b03] | 72 | -->
|
---|
[322f172] | 73 |
|
---|
| 74 | <bridgehead renderas="sect3">Shadow Dependencies</bridgehead>
|
---|
| 75 |
|
---|
| 76 | <bridgehead renderas="sect4">Required</bridgehead>
|
---|
[c6bdcb0] | 77 | <para role="required"><xref linkend="linux-pam"/> and/or
|
---|
| 78 | <xref linkend="cracklib"/></para>
|
---|
[322f172] | 79 |
|
---|
[3597eb6] | 80 | <para condition="html" role="usernotes">User Notes:
|
---|
| 81 | <ulink url="&blfs-wiki;/shadow"/></para>
|
---|
| 82 |
|
---|
[322f172] | 83 | </sect2>
|
---|
| 84 |
|
---|
| 85 | <sect2 role="installation">
|
---|
| 86 | <title>Installation of Shadow</title>
|
---|
| 87 |
|
---|
[c6bdcb0] | 88 | <important>
|
---|
| 89 | <para>The installation shown below is for a situation where
|
---|
| 90 | <application>Linux-PAM</application> has been installed (with or
|
---|
| 91 | without a <application>CrackLib</application> installation) and
|
---|
| 92 | <application>Shadow</application> is being reinstalled to support the
|
---|
| 93 | <application>Linux-PAM</application> installation. If you are
|
---|
| 94 | reinstalling <application>Shadow</application> to provide strong
|
---|
| 95 | password support via the <application>CrackLib</application> library
|
---|
| 96 | and you have not installed <application>Linux-PAM</application>, ensure
|
---|
[8f68b03] | 97 | you add the <parameter>--with-libcrack</parameter> parameter to the
|
---|
| 98 | <command>configure</command> script below.</para>
|
---|
[c6bdcb0] | 99 | </important>
|
---|
| 100 |
|
---|
[322f172] | 101 | <para>Reinstall <application>Shadow</application> by running the following
|
---|
| 102 | commands:</para>
|
---|
| 103 |
|
---|
[8f68b03] | 104 | <screen><userinput>./configure --libdir=/lib \
|
---|
[71e9f62] | 105 | --sysconfdir=/etc \
|
---|
[8f68b03] | 106 | --enable-shared \
|
---|
| 107 | --without-selinux &&
|
---|
[4fcf20a5] | 108 | sed -i 's/groups$(EXEEXT) //' src/Makefile &&
|
---|
[4d3f1239] | 109 | find man -name Makefile -exec sed -i '/groups/d' {} \; &&
|
---|
[71e9f62] | 110 | sed -i -e 's/ ko//' -e 's/ zh_CN zh_TW//' man/Makefile &&
|
---|
[8f68b03] | 111 |
|
---|
| 112 | for i in de es fi fr id it pt_BR; do
|
---|
| 113 | convert-mans UTF-8 ISO-8859-1 man/${i}/*.?
|
---|
| 114 | done &&
|
---|
| 115 |
|
---|
| 116 | for i in cs hu pl; do
|
---|
| 117 | convert-mans UTF-8 ISO-8859-2 man/${i}/*.?
|
---|
| 118 | done &&
|
---|
| 119 |
|
---|
| 120 | convert-mans UTF-8 EUC-JP man/ja/*.? &&
|
---|
| 121 | convert-mans UTF-8 KOI8-R man/ru/*.? &&
|
---|
| 122 | convert-mans UTF-8 ISO-8859-9 man/tr/*.? &&
|
---|
| 123 |
|
---|
[322f172] | 124 | make</userinput></screen>
|
---|
[17fb537e] | 125 |
|
---|
[31f3a57] | 126 | <para>This package does not come with a test suite.</para>
|
---|
| 127 |
|
---|
[322f172] | 128 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[17fb537e] | 129 |
|
---|
[322f172] | 130 | <screen role="root"><userinput>make install &&
|
---|
[4fcf20a5] | 131 | mv -v /usr/bin/passwd /bin &&
|
---|
| 132 | mv -v /lib/libshadow.*a /usr/lib &&
|
---|
| 133 | rm -v /lib/libshadow.so &&
|
---|
[322f172] | 134 | ln -v -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so</userinput></screen>
|
---|
[b4b71892] | 135 |
|
---|
[322f172] | 136 | </sect2>
|
---|
[b4b71892] | 137 |
|
---|
[322f172] | 138 | <sect2 role="commands">
|
---|
| 139 | <title>Command Explanations</title>
|
---|
[b4b71892] | 140 |
|
---|
[8f68b03] | 141 | <!-- Removed the -with-libpam and -without-libcrack options from the
|
---|
| 142 | default as these are the defaults. Pam will automatically be picked
|
---|
| 143 | up if it is installed, and CrackLib won't be used unless specifically
|
---|
| 144 | requested via -with-libcrack
|
---|
| 145 | <para><parameter>-without-libcrack</parameter>: This switch tells
|
---|
[322f172] | 146 | <application>Shadow</application> not to use
|
---|
| 147 | <filename class='libraryfile'>libcrack</filename>. This is desired as
|
---|
[d8684cbc] | 148 | <application>Linux-PAM</application> will provide
|
---|
| 149 | <filename class='libraryfile'>libcrack</filename> functionality.</para>
|
---|
[8f68b03] | 150 | -->
|
---|
| 151 |
|
---|
| 152 | <para><parameter>--without-selinux</parameter>: Support for selinux is
|
---|
| 153 | enabled by default, but selinux is not built in a base LFS system. The
|
---|
| 154 | <command>configure</command> script will fail if this option is not
|
---|
| 155 | used.</para>
|
---|
| 156 |
|
---|
| 157 | <para><command>sed -i 's/groups$(EXEEXT) //' src/Makefile</command>: This
|
---|
| 158 | command is used to suppress the installation of the
|
---|
| 159 | <command>groups</command> program as the version from the
|
---|
| 160 | <application>Coreutils</application> package installed during LFS is
|
---|
| 161 | preferred.</para>
|
---|
| 162 |
|
---|
| 163 | <para><command>find man -name Makefile -exec ... {} \;</command>: This
|
---|
| 164 | command is used to suppress the installation of the
|
---|
| 165 | <command>groups</command> man pages so the existing ones installed from
|
---|
| 166 | the <application>Coreutils</application> package are not replaced.</para>
|
---|
| 167 |
|
---|
| 168 | <para><command>sed -i -e '...' -e '...' man/Makefile</command>: This
|
---|
| 169 | command disables the installation of Chinese and Korean manual pages, since
|
---|
| 170 | <application>Man-DB</application> cannot format them properly.</para>
|
---|
| 171 |
|
---|
| 172 | <para><command>convert-mans ...</command>: These commands are used to
|
---|
| 173 | convert some of the man pages so that <application>Man-DB</application>
|
---|
[98fa7cc0] | 174 | will display them in the expected encodings.</para>
|
---|
[8f68b03] | 175 |
|
---|
| 176 | <para><command>mv -v /usr/bin/passwd /bin</command>: The
|
---|
| 177 | <command>passwd</command> program may be needed during times when the
|
---|
| 178 | <filename class='directory'>/usr</filename> filesystem is not mounted so
|
---|
| 179 | it is moved into the root partition.</para>
|
---|
| 180 |
|
---|
| 181 | <para><command>mv -v ...; rm -v ...; ln -v ...</command>: These commands
|
---|
| 182 | are used to move the <filename class='libraryfile'>libshadow</filename>
|
---|
| 183 | library to the root partition to support the moving of the
|
---|
| 184 | <command>passwd</command> program earlier.</para>
|
---|
[39975e9] | 185 |
|
---|
[322f172] | 186 | </sect2>
|
---|
[b4b71892] | 187 |
|
---|
[322f172] | 188 | <sect2 role="configuration">
|
---|
| 189 | <title>Configuring Linux-PAM to Work with Shadow</title>
|
---|
[b4b71892] | 190 |
|
---|
[8f68b03] | 191 | <note>
|
---|
[eb2eccc] | 192 | <para>The rest of this page is devoted to configuring
|
---|
[8f68b03] | 193 | <application>Shadow</application> to work properly with
|
---|
| 194 | <application>Linux-PAM</application>. If you do not have
|
---|
| 195 | <application>Linux-PAM</application> installed, and you reinstalled
|
---|
| 196 | <application>Shadow</application> to support strong passwords via
|
---|
| 197 | the <application>CrackLib</application> library, no further configuration
|
---|
| 198 | is required.</para>
|
---|
| 199 | </note>
|
---|
| 200 |
|
---|
[322f172] | 201 | <sect3 id="pam.d">
|
---|
| 202 | <title>Config Files</title>
|
---|
[b4b71892] | 203 |
|
---|
[1ba671c] | 204 | <para><filename>/etc/pam.d/*</filename> or alternatively
|
---|
| 205 | <filename>/etc/pam.conf, /etc/login.defs and
|
---|
| 206 | /etc/security/*</filename></para>
|
---|
[b4b71892] | 207 |
|
---|
[322f172] | 208 | <indexterm zone="shadow pam.d">
|
---|
| 209 | <primary sortas="e-etc-pam.d">/etc/pam.d/*</primary>
|
---|
| 210 | </indexterm>
|
---|
[2197589] | 211 |
|
---|
[322f172] | 212 | <indexterm zone="shadow pam.d">
|
---|
| 213 | <primary sortas="e-etc-pam.conf">/etc/pam.conf</primary>
|
---|
| 214 | </indexterm>
|
---|
[4fcf20a5] | 215 |
|
---|
[1ba671c] | 216 | <indexterm zone="shadow pam.d">
|
---|
| 217 | <primary sortas="e-etc-login.defs">/etc/login.defs</primary>
|
---|
| 218 | </indexterm>
|
---|
| 219 |
|
---|
| 220 | <indexterm zone="shadow pam.d">
|
---|
| 221 | <primary sortas="e-etc-security">/etc/security/*</primary>
|
---|
| 222 | </indexterm>
|
---|
| 223 |
|
---|
[322f172] | 224 | </sect3>
|
---|
| 225 |
|
---|
| 226 | <sect3>
|
---|
| 227 | <title>Configuration Information</title>
|
---|
| 228 |
|
---|
[8f68b03] | 229 | <para>Configuring your system to use <application>Linux-PAM</application>
|
---|
| 230 | can be a complex task. The information below will provide a basic setup
|
---|
| 231 | so that <application>Shadow</application>'s login and password
|
---|
| 232 | functionality will work effectively with
|
---|
| 233 | <application>Linux-PAM</application>. Review the information and links on
|
---|
| 234 | the <xref linkend="linux-pam"/> page for further configuration
|
---|
| 235 | information. For information specific to integrating
|
---|
| 236 | <application>Shadow</application>, <application>Linux-PAM</application>
|
---|
| 237 | and <application>CrackLib</application>, you can visit the following
|
---|
| 238 | links:</para>
|
---|
| 239 |
|
---|
| 240 | <itemizedlist spacing="compact">
|
---|
| 241 | <listitem>
|
---|
| 242 | <para><ulink
|
---|
| 243 | url="http://www.kernel.org/pub/linux/libs/pam/Linux-PAM-html/pam-6.html#ss6.3"/></para>
|
---|
| 244 | </listitem>
|
---|
| 245 | <listitem>
|
---|
| 246 | <para><ulink
|
---|
| 247 | url="http://www.deer-run.com/~hal/sysadmin/pam_cracklib.html"/></para>
|
---|
| 248 | </listitem>
|
---|
| 249 | </itemizedlist>
|
---|
| 250 |
|
---|
[1ba671c] | 251 | <sect4 id="pam-login-defs">
|
---|
| 252 | <title>Configuring /etc/login.defs</title>
|
---|
| 253 |
|
---|
| 254 | <para>The <command>login</command> program currently performs many
|
---|
| 255 | functions which <application>Linux-PAM</application> modules should
|
---|
| 256 | now handle. The following <command>sed</command> command will comment
|
---|
| 257 | out the appropriate lines in <filename>/etc/login.defs</filename>, and
|
---|
| 258 | stop <command>login</command> from performing these functions (a backup
|
---|
| 259 | file named <filename>/etc/login.defs.orig</filename> is also created
|
---|
[d8684cbc] | 260 | to preserve the original file's contents). Issue the following commands
|
---|
| 261 | as the <systemitem class="username">root</systemitem> user:</para>
|
---|
[1ba671c] | 262 |
|
---|
| 263 | <indexterm zone="shadow pam-login-defs">
|
---|
| 264 | <primary sortas="e-etc-login.defs">/etc/login.defs</primary>
|
---|
| 265 | </indexterm>
|
---|
| 266 |
|
---|
| 267 | <screen role="root"><userinput>install -v -m644 /etc/login.defs /etc/login.defs.orig &&
|
---|
| 268 | for FUNCTION in LASTLOG_ENAB MAIL_CHECK_ENAB \
|
---|
| 269 | PORTTIME_CHECKS_ENAB CONSOLE \
|
---|
| 270 | MOTD_FILE NOLOGINS_FILE PASS_MIN_LEN \
|
---|
| 271 | SU_WHEEL_ONLY MD5_CRYPT_ENAB \
|
---|
| 272 | CONSOLE_GROUPS ENVIRON_FILE \
|
---|
| 273 | ULIMIT ENV_TZ ENV_HZ ENV_SUPATH \
|
---|
| 274 | ENV_PATH QMAIL_DIR MAIL_DIR MAIL_FILE \
|
---|
[8f68b03] | 275 | CHFN_AUTH FAILLOG_ENAB QUOTAS_ENAB FTMP_FILE \
|
---|
| 276 | OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
|
---|
[71e9f62] | 277 | PASS_CHANGE_TRIES PASS_ALWAYS_WARN ISSUE_FILE
|
---|
[1ba671c] | 278 | do
|
---|
[d8684cbc] | 279 | sed -i "s/^$FUNCTION/# &/" /etc/login.defs
|
---|
[1ba671c] | 280 | done</userinput></screen>
|
---|
| 281 |
|
---|
[8f68b03] | 282 | <!-- Moved the commenting of these four parameters into the section
|
---|
| 283 | above. If PAM is installed, it complains if these are not commented
|
---|
| 284 | regardless if CrackLib is installed.
|
---|
| 285 |
|
---|
[1ba671c] | 286 | <para>If you have <application>CrackLib</application> installed,
|
---|
[d8684cbc] | 287 | also comment out four more lines using the following command as the
|
---|
| 288 | <systemitem class="username">root</systemitem> user:</para>
|
---|
[1ba671c] | 289 |
|
---|
| 290 | <screen role="root"><userinput>for FUNCTION in OBSCURE_CHECKS_ENAB CRACKLIB_DICTPATH \
|
---|
| 291 | PASS_CHANGE_TRIES PASS_ALWAYS_WARN
|
---|
| 292 | do
|
---|
[d8684cbc] | 293 | sed -i "s/^$FUNCTION/# &/" /etc/login.defs
|
---|
[1ba671c] | 294 | done</userinput></screen>
|
---|
| 295 |
|
---|
[8f68b03] | 296 | -->
|
---|
| 297 |
|
---|
[1ba671c] | 298 | </sect4>
|
---|
| 299 |
|
---|
| 300 | <sect4>
|
---|
| 301 | <title>Configuring the /etc/pam.d/ Files</title>
|
---|
| 302 |
|
---|
[29f80ebc] | 303 | <para>As mentioned previously in the
|
---|
| 304 | <application>Linux-PAM</application> instructions,
|
---|
| 305 | <application>Linux-PAM</application> has two supported methods for
|
---|
| 306 | configuration. The commands below assume that you've chosen to use
|
---|
| 307 | a directory based configuration, where each program has its own
|
---|
[eb2eccc] | 308 | configuration file. You can optionally use a single
|
---|
[29f80ebc] | 309 | <filename>/etc/pam.conf</filename> configuration file by using the
|
---|
| 310 | text from the files below, and supplying the program name as an
|
---|
[eb2eccc] | 311 | additional first field for each line.</para>
|
---|
| 312 |
|
---|
| 313 | <para>As the <systemitem class="username">root</systemitem> user,
|
---|
| 314 | create the <filename class="directory">/etc/pam.d</filename>
|
---|
| 315 | directory with the following command:</para>
|
---|
| 316 |
|
---|
[4c31e6de] | 317 | <screen role="root"><userinput>install -v -d -m755 /etc/pam.d</userinput></screen>
|
---|
[eb2eccc] | 318 |
|
---|
[29f80ebc] | 319 | <para>While still the <systemitem class="username">root</systemitem>
|
---|
| 320 | user, add the following <application>Linux-PAM</application>
|
---|
[eb2eccc] | 321 | configuration files to the
|
---|
[29f80ebc] | 322 | <filename class="directory">/etc/pam.d/</filename> directory (or
|
---|
| 323 | add the contents to the <filename>/etc/pam.conf</filename> file) with
|
---|
[eb2eccc] | 324 | the following commands:</para>
|
---|
[1ba671c] | 325 |
|
---|
| 326 | </sect4>
|
---|
[322f172] | 327 |
|
---|
| 328 | <sect4>
|
---|
[974951c] | 329 | <title>'login' (with CrackLib)</title>
|
---|
[322f172] | 330 |
|
---|
| 331 | <screen role="root"><userinput>cat > /etc/pam.d/login << "EOF"
|
---|
| 332 | <literal># Begin /etc/pam.d/login
|
---|
[4fcf20a5] | 333 |
|
---|
| 334 | auth requisite pam_securetty.so
|
---|
| 335 | auth requisite pam_nologin.so
|
---|
| 336 | auth required pam_unix.so
|
---|
| 337 | account required pam_access.so
|
---|
| 338 | account required pam_unix.so
|
---|
[7fb0e285] | 339 | session required pam_env.so
|
---|
[4fcf20a5] | 340 | session required pam_motd.so
|
---|
| 341 | session required pam_limits.so
|
---|
| 342 | session optional pam_mail.so dir=/var/mail standard
|
---|
| 343 | session optional pam_lastlog.so
|
---|
| 344 | session required pam_unix.so
|
---|
| 345 | password required pam_cracklib.so retry=3 difok=8 minlen=5 \
|
---|
| 346 | dcredit=3 ocredit=3 \
|
---|
| 347 | ucredit=2 lcredit=2
|
---|
| 348 | password required pam_unix.so md5 shadow use_authtok
|
---|
| 349 |
|
---|
[322f172] | 350 | # End /etc/pam.d/login</literal>
|
---|
| 351 | EOF</userinput></screen>
|
---|
| 352 |
|
---|
| 353 | </sect4>
|
---|
[4fcf20a5] | 354 |
|
---|
[322f172] | 355 | <sect4>
|
---|
[974951c] | 356 | <title>'login' (without CrackLib)</title>
|
---|
[4fcf20a5] | 357 |
|
---|
[322f172] | 358 | <screen role="root"><userinput>cat > /etc/pam.d/login << "EOF"
|
---|
| 359 | <literal># Begin /etc/pam.d/login
|
---|
[b4b71892] | 360 |
|
---|
| 361 | auth requisite pam_securetty.so
|
---|
| 362 | auth requisite pam_nologin.so
|
---|
| 363 | auth required pam_env.so
|
---|
| 364 | auth required pam_unix.so
|
---|
| 365 | account required pam_access.so
|
---|
| 366 | account required pam_unix.so
|
---|
| 367 | session required pam_motd.so
|
---|
| 368 | session required pam_limits.so
|
---|
[4fcf20a5] | 369 | session optional pam_mail.so dir=/var/mail standard
|
---|
[b4b71892] | 370 | session optional pam_lastlog.so
|
---|
| 371 | session required pam_unix.so
|
---|
[4fcf20a5] | 372 | password required pam_unix.so md5 shadow
|
---|
[b4b71892] | 373 |
|
---|
[322f172] | 374 | # End /etc/pam.d/login</literal>
|
---|
| 375 | EOF</userinput></screen>
|
---|
[4fcf20a5] | 376 |
|
---|
[322f172] | 377 | </sect4>
|
---|
[4fcf20a5] | 378 |
|
---|
[322f172] | 379 | <sect4>
|
---|
[974951c] | 380 | <title>'passwd' (with CrackLib)</title>
|
---|
[322f172] | 381 |
|
---|
| 382 | <screen role="root"><userinput>cat > /etc/pam.d/passwd << "EOF"
|
---|
| 383 | <literal># Begin /etc/pam.d/passwd
|
---|
[b4b71892] | 384 |
|
---|
[4fcf20a5] | 385 | password required pam_cracklib.so retry=3 difok=8 minlen=5 \
|
---|
| 386 | dcredit=3 ocredit=3 \
|
---|
| 387 | ucredit=2 lcredit=2
|
---|
| 388 | password required pam_unix.so md5 shadow use_authtok
|
---|
[b4b71892] | 389 |
|
---|
[322f172] | 390 | # End /etc/pam.d/passwd</literal>
|
---|
| 391 | EOF</userinput></screen>
|
---|
| 392 |
|
---|
| 393 | </sect4>
|
---|
[b4b71892] | 394 |
|
---|
[322f172] | 395 | <sect4>
|
---|
[974951c] | 396 | <title>'passwd' (without CrackLib)</title>
|
---|
[4fcf20a5] | 397 |
|
---|
[322f172] | 398 | <screen role="root"><userinput>cat > /etc/pam.d/passwd << "EOF"
|
---|
| 399 | <literal># Begin /etc/pam.d/passwd
|
---|
[4fcf20a5] | 400 |
|
---|
| 401 | password required pam_unix.so md5 shadow
|
---|
[b4b71892] | 402 |
|
---|
[322f172] | 403 | # End /etc/pam.d/passwd</literal>
|
---|
| 404 | EOF</userinput></screen>
|
---|
| 405 |
|
---|
| 406 | </sect4>
|
---|
[4fcf20a5] | 407 |
|
---|
[322f172] | 408 | <sect4>
|
---|
| 409 | <title>'su'</title>
|
---|
[4fcf20a5] | 410 |
|
---|
[322f172] | 411 | <screen role="root"><userinput>cat > /etc/pam.d/su << "EOF"
|
---|
| 412 | <literal># Begin /etc/pam.d/su
|
---|
[b4b71892] | 413 |
|
---|
| 414 | auth sufficient pam_rootok.so
|
---|
| 415 | auth required pam_unix.so
|
---|
| 416 | account required pam_unix.so
|
---|
[4fcf20a5] | 417 | session optional pam_mail.so dir=/var/mail standard
|
---|
[7fb0e285] | 418 | session required pam_env.so
|
---|
[b4b71892] | 419 | session required pam_unix.so
|
---|
| 420 |
|
---|
[322f172] | 421 | # End /etc/pam.d/su</literal>
|
---|
| 422 | EOF</userinput></screen>
|
---|
[b4b71892] | 423 |
|
---|
[322f172] | 424 | </sect4>
|
---|
[b4b71892] | 425 |
|
---|
[322f172] | 426 | <sect4>
|
---|
| 427 | <title>'chage'</title>
|
---|
| 428 |
|
---|
| 429 | <screen role="root"><userinput>cat > /etc/pam.d/chage << "EOF"
|
---|
| 430 | <literal># Begin /etc/pam.d/chage
|
---|
[b4b71892] | 431 |
|
---|
| 432 | auth sufficient pam_rootok.so
|
---|
| 433 | auth required pam_unix.so
|
---|
| 434 | account required pam_unix.so
|
---|
| 435 | session required pam_unix.so
|
---|
| 436 | password required pam_permit.so
|
---|
| 437 |
|
---|
[322f172] | 438 | # End /etc/pam.d/chage</literal>
|
---|
| 439 | EOF</userinput></screen>
|
---|
| 440 |
|
---|
| 441 | </sect4>
|
---|
[b4b71892] | 442 |
|
---|
[322f172] | 443 | <sect4>
|
---|
| 444 | <title>'chpasswd', 'newusers', 'groupadd', 'groupdel',
|
---|
| 445 | 'groupmod', 'useradd', 'userdel', and 'usermod'</title>
|
---|
[39975e9] | 446 |
|
---|
[322f172] | 447 | <screen role="root"><userinput>for PROGRAM in chpasswd newusers groupadd groupdel \
|
---|
[4fcf20a5] | 448 | groupmod useradd userdel usermod
|
---|
| 449 | do
|
---|
[904f31e2] | 450 | install -v -m644 /etc/pam.d/chage /etc/pam.d/$PROGRAM
|
---|
[d8684cbc] | 451 | sed -i "s/chage/$PROGRAM/" /etc/pam.d/$PROGRAM
|
---|
[322f172] | 452 | done</userinput></screen>
|
---|
| 453 |
|
---|
| 454 | <warning>
|
---|
| 455 | <para>At this point, you should do a simple test to see if
|
---|
| 456 | <application>Shadow</application> is working as expected. Open
|
---|
[1ba671c] | 457 | another terminal and log in as a user, then <command>su</command> to
|
---|
[974951c] | 458 | <systemitem class="username">root</systemitem>. If you do not see any
|
---|
| 459 | errors, then all is well and you should proceed with the rest of the
|
---|
[322f172] | 460 | configuration. If you did receive errors, stop now and double check
|
---|
[b65246b] | 461 | the above configuration files manually. You can also run the test
|
---|
| 462 | suite from the <application>Linux-PAM</application> package to assist
|
---|
| 463 | you in determining the problem. If you cannot find and
|
---|
[322f172] | 464 | fix the error, you should recompile <application>Shadow</application>
|
---|
| 465 | replacing <option>--with-libpam</option> with
|
---|
[1ba671c] | 466 | <option>--without-libpam</option> in the above instructions (also move
|
---|
| 467 | the <filename>/etc/login.defs.orig</filename> backup file to
|
---|
| 468 | <filename>/etc/login.defs</filename>). If you
|
---|
[322f172] | 469 | fail to do this and the errors remain, you will be unable to log into
|
---|
| 470 | your system.</para>
|
---|
| 471 | </warning>
|
---|
| 472 |
|
---|
[349b53dd] | 473 | </sect4>
|
---|
| 474 |
|
---|
| 475 | <sect4>
|
---|
| 476 | <title>Other</title>
|
---|
| 477 |
|
---|
[322f172] | 478 | <para>Currently, <filename>/etc/pam.d/other</filename> is configured
|
---|
| 479 | to allow anyone with an account on the machine to use PAM-aware
|
---|
| 480 | programs without a configuration file for that program. After testing
|
---|
| 481 | <application>Linux-PAM</application> for proper configuration, install
|
---|
| 482 | a more restrictive <filename>other</filename> file so that
|
---|
| 483 | program-specific configuration files are required:</para>
|
---|
| 484 |
|
---|
| 485 | <screen role="root"><userinput>cat > /etc/pam.d/other << "EOF"
|
---|
| 486 | <literal># Begin /etc/pam.d/other
|
---|
[b4b71892] | 487 |
|
---|
| 488 | auth required pam_deny.so
|
---|
| 489 | auth required pam_warn.so
|
---|
| 490 | account required pam_deny.so
|
---|
| 491 | session required pam_deny.so
|
---|
| 492 | password required pam_deny.so
|
---|
| 493 | password required pam_warn.so
|
---|
| 494 |
|
---|
[322f172] | 495 | # End /etc/pam.d/other</literal>
|
---|
| 496 | EOF</userinput></screen>
|
---|
[4fcf20a5] | 497 |
|
---|
[b65246b] | 498 | <para>If you preserved the source tree from the
|
---|
| 499 | <application>Linux-PAM</application> package (or you feel like unpacking
|
---|
| 500 | that tarball, then running <command>configure</command> and
|
---|
| 501 | <command>make</command>), now would be a good time to run the test
|
---|
| 502 | suite from this package. This test suite will use the configuration you
|
---|
| 503 | just finished during the tests. All the tests should pass.</para>
|
---|
| 504 |
|
---|
[322f172] | 505 | </sect4>
|
---|
[4fcf20a5] | 506 |
|
---|
[322f172] | 507 | <sect4 id="pam-access">
|
---|
| 508 | <title>Configuring Login Access</title>
|
---|
[4fcf20a5] | 509 |
|
---|
[322f172] | 510 | <para>Instead of using the <filename>/etc/login.access</filename>
|
---|
| 511 | file for controlling access to the system,
|
---|
| 512 | <application>Linux-PAM</application> uses the
|
---|
| 513 | <filename class='libraryfile'>pam_access.so</filename> module along
|
---|
| 514 | with the <filename>/etc/security/access.conf</filename> file. Rename
|
---|
| 515 | the <filename>/etc/login.access</filename> file using the following
|
---|
| 516 | command:</para>
|
---|
| 517 |
|
---|
| 518 | <indexterm zone="shadow pam-access">
|
---|
| 519 | <primary sortas="e-etc-security-access.conf">/etc/security/access.conf</primary>
|
---|
| 520 | </indexterm>
|
---|
| 521 |
|
---|
| 522 | <screen role="root"><userinput>if [ -f /etc/login.access ]; then
|
---|
[4fcf20a5] | 523 | mv -v /etc/login.access /etc/login.access.NOUSE
|
---|
[322f172] | 524 | fi</userinput></screen>
|
---|
| 525 |
|
---|
| 526 | </sect4>
|
---|
| 527 |
|
---|
| 528 | <sect4 id="pam-limits">
|
---|
| 529 | <title>Configuring Resource Limits</title>
|
---|
| 530 |
|
---|
| 531 | <para>Instead of using the <filename>/etc/limits</filename> file
|
---|
| 532 | for limiting usage of system resources,
|
---|
| 533 | <application>Linux-PAM</application> uses the
|
---|
| 534 | <filename class='libraryfile'>pam_limits.so</filename> module along
|
---|
| 535 | with the <filename>/etc/security/limits.conf</filename> file. Rename
|
---|
| 536 | the <filename>/etc/limits</filename> file using the following
|
---|
| 537 | command:</para>
|
---|
| 538 |
|
---|
| 539 | <indexterm zone="shadow pam-limits">
|
---|
| 540 | <primary sortas="e-etc-security-limits.conf">/etc/security/limits.conf</primary>
|
---|
| 541 | </indexterm>
|
---|
| 542 |
|
---|
| 543 | <screen role="root"><userinput>if [ -f /etc/limits ]; then
|
---|
[4fcf20a5] | 544 | mv -v /etc/limits /etc/limits.NOUSE
|
---|
[322f172] | 545 | fi</userinput></screen>
|
---|
| 546 |
|
---|
| 547 | </sect4>
|
---|
[4fcf20a5] | 548 |
|
---|
[7fb0e285] | 549 | <sect4 id="pam-env">
|
---|
| 550 | <title>Configuring Default Environment</title>
|
---|
| 551 |
|
---|
[bccbdaea] | 552 | <para>During previous configuration, several items were removed from
|
---|
[7fb0e285] | 553 | <filename>/etc/login.defs</filename>. Some of these items are now
|
---|
[bccbdaea] | 554 | controlled by the <filename class='libraryfile'>pam_env.so</filename>
|
---|
| 555 | module and the <filename>/etc/security/pam_env.conf</filename>
|
---|
| 556 | configuration file. In particular, the default path has been
|
---|
| 557 | changed. To recover your default path, execute the following
|
---|
[7fb0e285] | 558 | commands:</para>
|
---|
| 559 |
|
---|
[d8684cbc] | 560 | <screen role="root"><userinput>ENV_PATH=`grep '^ENV_PATH' /etc/login.defs.orig | \
|
---|
[7fb0e285] | 561 | awk '{ print $2 }' | sed 's/PATH=//'` &&
|
---|
[d8684cbc] | 562 | echo 'PATH DEFAULT='`echo "${ENV_PATH}"`\
|
---|
| 563 | ' OVERRIDE=${PATH}' \
|
---|
[7fb0e285] | 564 | >> /etc/security/pam_env.conf &&
|
---|
[d8684cbc] | 565 | unset ENV_PATH</userinput></screen>
|
---|
[7fb0e285] | 566 |
|
---|
[d8684cbc] | 567 | <note>
|
---|
[bccbdaea] | 568 | <para>ENV_SUPATH is no longer supported. You must create
|
---|
| 569 | a valid <filename>/root/.bashrc</filename> file to provide a
|
---|
[d8684cbc] | 570 | modified path for the super-user.</para>
|
---|
| 571 | </note>
|
---|
[7fb0e285] | 572 |
|
---|
| 573 | </sect4>
|
---|
| 574 |
|
---|
[322f172] | 575 | </sect3>
|
---|
[b4b71892] | 576 |
|
---|
[322f172] | 577 | </sect2>
|
---|
[f45b1953] | 578 |
|
---|
[322f172] | 579 | <sect2 role="content">
|
---|
| 580 | <title>Contents</title>
|
---|
[17fb537e] | 581 |
|
---|
[322f172] | 582 | <para>A list of the installed files, along with their short descriptions
|
---|
| 583 | can be found at
|
---|
| 584 | <ulink url="&lfs-root;/chapter06/shadow.html#contents-shadow"/>.</para>
|
---|
[17fb537e] | 585 |
|
---|
[322f172] | 586 | </sect2>
|
---|
[17fb537e] | 587 |
|
---|
[f45b1953] | 588 | </sect1>
|
---|