[673b0d8] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
| 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN" "http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd" [
|
---|
| 3 | <!ENTITY % general-entities SYSTEM "../general.ent">
|
---|
| 4 | %general-entities;
|
---|
| 5 | ]>
|
---|
[a001133] | 6 | <sect1 id="ch-system-shadow" xreflabel="Shadow" role="wrap">
|
---|
[673b0d8] | 7 | <title>Shadow-&shadow-version;</title>
|
---|
| 8 | <?dbhtml filename="shadow.html"?>
|
---|
| 9 |
|
---|
| 10 | <indexterm zone="ch-system-shadow"><primary sortas="a-Shadow">Shadow</primary></indexterm>
|
---|
[6370fa6] | 11 |
|
---|
[a001133] | 12 | <sect2 role="package"><title/>
|
---|
[5888299] | 13 | <para>The Shadow package contains programs for handling passwords in a secure
|
---|
| 14 | way.</para>
|
---|
| 15 |
|
---|
[a001133] | 16 | <segmentedlist>
|
---|
| 17 | <segtitle>&buildtime;</segtitle>
|
---|
| 18 | <segtitle>&diskspace;</segtitle>
|
---|
| 19 | <seglistitem><seg>0.4 SBU</seg><seg>11 MB</seg></seglistitem>
|
---|
| 20 | </segmentedlist>
|
---|
[673b0d8] | 21 |
|
---|
[a001133] | 22 | <segmentedlist>
|
---|
| 23 | <segtitle>Shadow installation depends on</segtitle>
|
---|
| 24 | <seglistitem><seg>Bash, Binutils, Bison, Coreutils,
|
---|
| 25 | Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed</seg></seglistitem>
|
---|
| 26 | </segmentedlist>
|
---|
| 27 | </sect2>
|
---|
[3554fa3a] | 28 |
|
---|
[a001133] | 29 | <sect2 role="installation">
|
---|
[73aedd1d] | 30 | <title>Installation of Shadow</title>
|
---|
| 31 |
|
---|
[6820da0] | 32 | <para>Prepare Shadow for compilation:</para>
|
---|
[73aedd1d] | 33 |
|
---|
[d0a6c4c] | 34 | <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
|
---|
[73aedd1d] | 35 |
|
---|
[d0a6c4c] | 36 | <para>Work around a problem that prevents Shadow's internationalization from
|
---|
| 37 | working:</para>
|
---|
[73aedd1d] | 38 |
|
---|
[cd0c92d6] | 39 | <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen>
|
---|
[73aedd1d] | 40 |
|
---|
[9dfc02f] | 41 | <para>Shadow incorrectly declares the malloc() function, causing compilation
|
---|
| 42 | failure. Fix this:</para>
|
---|
| 43 |
|
---|
| 44 | <screen><userinput>sed -i '/extern char/d' libmisc/xmalloc.c</userinput></screen>
|
---|
| 45 |
|
---|
[73aedd1d] | 46 | <para>Compile the package:</para>
|
---|
| 47 |
|
---|
| 48 | <screen><userinput>make</userinput></screen>
|
---|
| 49 |
|
---|
[673b0d8] | 50 | <para>Then install it:</para>
|
---|
[73aedd1d] | 51 |
|
---|
| 52 | <screen><userinput>make install</userinput></screen>
|
---|
| 53 |
|
---|
| 54 | <para>Shadow uses two files to configure authentication settings for the
|
---|
| 55 | system. Install these two config files:</para>
|
---|
| 56 |
|
---|
| 57 | <screen><userinput>cp etc/{limits,login.access} /etc</userinput></screen>
|
---|
| 58 |
|
---|
[c21999c6] | 59 | <para>Instead of using the default <emphasis>crypt</emphasis> method, we want
|
---|
| 60 | to use the more secure <emphasis>MD5</emphasis> method of password encryption,
|
---|
[673b0d8] | 61 | which also allows passwords longer than 8 characters. We also need to
|
---|
[c21999c6] | 62 | change the obsolete <filename class="directory">/var/spool/mail</filename>
|
---|
[673b0d8] | 63 | location for user mailboxes that Shadow uses by default to the <filename
|
---|
| 64 | class="directory">/var/mail</filename> location used currently. We accomplish
|
---|
[c21999c6] | 65 | both these things by changing the relevant configuration file while copying it
|
---|
| 66 | to its destination (it's probably better to cut-and-paste this rather than try
|
---|
| 67 | and type it all in):</para>
|
---|
| 68 |
|
---|
| 69 | <screen><userinput>sed -e 's%#MD5_CRYPT_ENAB.no%MD5_CRYPT_ENAB yes%' \
|
---|
[673b0d8] | 70 | -e 's%/var/spool/mail%/var/mail%' \
|
---|
| 71 | etc/login.defs.linux > /etc/login.defs</userinput></screen>
|
---|
[73aedd1d] | 72 |
|
---|
[6820da0] | 73 | <para>Move some misplaced symlinks/programs to their proper locations:</para>
|
---|
[73aedd1d] | 74 |
|
---|
[d0a6c4c] | 75 | <screen><userinput>mv /bin/sg /usr/bin
|
---|
[6820da0] | 76 | mv /bin/vigr /usr/sbin
|
---|
| 77 | mv /usr/bin/passwd /bin</userinput></screen>
|
---|
[73aedd1d] | 78 |
|
---|
| 79 | <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
|
---|
| 80 |
|
---|
| 81 | <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
|
---|
| 82 |
|
---|
| 83 | <para>As some packages expect to find the just-moved libraries in
|
---|
| 84 | <filename>/usr/lib</filename>, create the following symlinks:</para>
|
---|
| 85 |
|
---|
| 86 | <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
|
---|
| 87 | ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
|
---|
| 88 |
|
---|
[638a816e] | 89 | <para>The -D option of the <filename>useradd</filename> program requires this
|
---|
| 90 | directory for it to work properly:</para>
|
---|
| 91 |
|
---|
| 92 | <screen><userinput>mkdir /etc/default</userinput></screen>
|
---|
| 93 |
|
---|
[90e3cb3] | 94 | <para>Coreutils has already installed a better <command>groups</command>
|
---|
[c21999c6] | 95 | program in <filename class="directory">/usr/bin</filename>. Remove the one
|
---|
| 96 | installed by Shadow:</para>
|
---|
[73aedd1d] | 97 |
|
---|
| 98 | <screen><userinput>rm /bin/groups</userinput></screen>
|
---|
| 99 |
|
---|
| 100 | </sect2>
|
---|
[24351aa] | 101 |
|
---|
[2309b72] | 102 |
|
---|
[673b0d8] | 103 | <sect2 id="conf-shadow"><title>Configuring Shadow</title>
|
---|
| 104 | <indexterm zone="conf-shadow">
|
---|
| 105 | <primary sortas="a-Shadow">Shadow</primary>
|
---|
| 106 | <secondary>configuring</secondary></indexterm>
|
---|
[2309b72] | 107 |
|
---|
[c21999c6] | 108 | <para>This package contains utilities to add, modify and delete users and
|
---|
| 109 | groups, set and change their passwords, and other such administrative tasks.
|
---|
| 110 | For a full explanation of what <emphasis>password shadowing</emphasis> means,
|
---|
| 111 | see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
|
---|
| 112 | There's one thing to keep in mind if you decide to use Shadow support: programs
|
---|
| 113 | that need to verify passwords (display managers, ftp programs, pop3 daemons,
|
---|
| 114 | and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
|
---|
| 115 | need to be able to work with shadowed passwords.</para>
|
---|
[2309b72] | 116 |
|
---|
| 117 | <para>To enable shadowed passwords, run the following command:</para>
|
---|
| 118 |
|
---|
[cd1ddd7] | 119 | <screen><userinput>pwconv</userinput></screen>
|
---|
[2309b72] | 120 |
|
---|
[673b0d8] | 121 | <para>To enable shadowed group passwords, run:</para>
|
---|
[2309b72] | 122 |
|
---|
[cd1ddd7] | 123 | <screen><userinput>grpconv</userinput></screen>
|
---|
[2309b72] | 124 |
|
---|
| 125 | <para>Under normal circumstances, you won't have created any passwords yet.
|
---|
[c21999c6] | 126 | However, if returning to this section later to enable shadowing, you should
|
---|
| 127 | reset any current user passwords with the <command>passwd</command> command or
|
---|
| 128 | any group passwords with the <command>gpasswd</command> command.</para>
|
---|
| 129 |
|
---|
[2309b72] | 130 | </sect2>
|
---|
| 131 |
|
---|
[c21999c6] | 132 |
|
---|
[2309b72] | 133 | <sect2>
|
---|
| 134 | <title>Setting the root password</title>
|
---|
| 135 |
|
---|
| 136 | <para>Choose a password for user root and set it via:</para>
|
---|
| 137 |
|
---|
| 138 | <screen><userinput>passwd root</userinput></screen>
|
---|
| 139 |
|
---|
| 140 | </sect2>
|
---|
[24351aa] | 141 |
|
---|
[5888299] | 142 |
|
---|
[673b0d8] | 143 | <sect2 id="contents-shadow"><title>Contents of Shadow</title>
|
---|
| 144 |
|
---|
| 145 | <para><emphasis>Installed programs</emphasis>: chage, chfn, chpasswd, chsh,
|
---|
| 146 | dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck,
|
---|
| 147 | grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers,
|
---|
| 148 | passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod,
|
---|
| 149 | vigr (link to vipw) and vipw</para>
|
---|
| 150 |
|
---|
| 151 | </sect2>
|
---|
| 152 |
|
---|
| 153 | <sect2><title>Short descriptions</title>
|
---|
| 154 |
|
---|
| 155 | <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
|
---|
| 156 | <para id="chage"><command>chage</command> is used to change the maximum number of
|
---|
| 157 | days between obligatory password changes.</para>
|
---|
| 158 |
|
---|
| 159 | <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
|
---|
| 160 | <para id="chfn"><command>chfn</command> is used to change a user's full name and
|
---|
| 161 | some other info.</para>
|
---|
| 162 |
|
---|
| 163 | <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
|
---|
| 164 | <para id="chpasswd"><command>chpasswd</command> is used to update the passwords of a
|
---|
| 165 | whole series of user accounts in one go.</para>
|
---|
| 166 |
|
---|
| 167 | <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
|
---|
| 168 | <para id="chsh"><command>chsh</command> is used to change a user's default
|
---|
| 169 | login shell.</para>
|
---|
| 170 |
|
---|
| 171 | <indexterm zone="ch-system-shadow dpasswd"><primary sortas="b-dpasswd">dpasswd</primary></indexterm>
|
---|
| 172 | <para id="dpasswd"><command>dpasswd</command> is used to change dial-up passwords for
|
---|
| 173 | user login shells.</para>
|
---|
| 174 |
|
---|
| 175 | <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
|
---|
| 176 | <para id="expiry"><command>expiry</command> checks and enforces the current password
|
---|
| 177 | expiration policy.</para>
|
---|
| 178 |
|
---|
| 179 | <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
|
---|
| 180 | <para id="faillog"><command>faillog</command> is used to examine the log of login
|
---|
| 181 | failures, to set a maximum number of failures before an account is blocked,
|
---|
| 182 | or to reset the failure count.</para>
|
---|
| 183 |
|
---|
| 184 | <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
|
---|
| 185 | <para id="gpasswd"><command>gpasswd</command> is used to add and delete members and
|
---|
| 186 | administrators to groups.</para>
|
---|
| 187 |
|
---|
| 188 | <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
|
---|
| 189 | <para id="groupadd"><command>groupadd</command> creates a group with the given
|
---|
| 190 | name.</para>
|
---|
| 191 |
|
---|
| 192 | <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
|
---|
| 193 | <para id="groupdel"><command>groupdel</command> deletes the group with the given
|
---|
| 194 | name.</para>
|
---|
| 195 |
|
---|
| 196 | <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
|
---|
| 197 | <para id="groupmod"><command>groupmod</command> is used to modify the given group's
|
---|
| 198 | name or GID.</para>
|
---|
| 199 |
|
---|
| 200 | <indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
|
---|
| 201 | <para id="groups"><command>groups</command> reports the groups of which the given
|
---|
| 202 | users are members.</para>
|
---|
| 203 |
|
---|
| 204 | <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
|
---|
| 205 | <para id="grpck"><command>grpck</command> verifies the integrity of the group files,
|
---|
| 206 | <filename>/etc/group</filename> and <filename>/etc/gshadow</filename>.</para>
|
---|
| 207 |
|
---|
| 208 | <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
|
---|
| 209 | <para id="grpconv"><command>grpconv</command> creates or updates the shadow group file
|
---|
| 210 | from the normal group file.</para>
|
---|
| 211 |
|
---|
| 212 | <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
|
---|
| 213 | <para id="grpunconv"><command>grpunconv</command> updates <filename>/etc/group</filename>
|
---|
| 214 | from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
|
---|
| 215 |
|
---|
| 216 | <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
|
---|
| 217 | <para id="lastlog"><command>lastlog</command> reports the most recent login of all
|
---|
| 218 | users, or of a given user.</para>
|
---|
[73aedd1d] | 219 |
|
---|
[673b0d8] | 220 | <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
|
---|
| 221 | <para id="login"><command>login</command> is used by the system to let users sign on.</para>
|
---|
| 222 |
|
---|
| 223 | <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
|
---|
| 224 | <para id="logoutd"><command>logoutd</command> is a daemon used to enforce restrictions
|
---|
| 225 | on log-on time and ports.</para>
|
---|
| 226 |
|
---|
| 227 | <indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
|
---|
| 228 | <para id="mkpasswd"><command>mkpasswd</command> encrypts the given password using the
|
---|
| 229 | also given perturbation.</para>
|
---|
| 230 |
|
---|
| 231 | <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
|
---|
| 232 | <para id="newgrp"><command>newgrp</command> is used to change the current GID during
|
---|
| 233 | a login session.</para>
|
---|
| 234 |
|
---|
| 235 | <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
|
---|
| 236 | <para id="newusers"><command>newusers</command> is used to create or update a whole
|
---|
| 237 | series of user accounts in one go.</para>
|
---|
| 238 |
|
---|
| 239 | <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
|
---|
| 240 | <para id="passwd"><command>passwd</command> is used to change the password for a user
|
---|
| 241 | or group account.</para>
|
---|
| 242 |
|
---|
| 243 | <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
|
---|
| 244 | <para id="pwck"><command>pwck</command> verifies the integrity of the password files,
|
---|
| 245 | <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
|
---|
| 246 |
|
---|
| 247 | <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
|
---|
| 248 | <para id="pwconv"><command>pwconv</command> creates or updates the shadow password file
|
---|
| 249 | from the normal password file.</para>
|
---|
| 250 |
|
---|
| 251 | <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
|
---|
| 252 | <para id="pwunconv"><command>pwunconv</command> updates <filename>/etc/passwd</filename>
|
---|
| 253 | from <filename>/etc/shadow</filename> and then deletes the latter.</para>
|
---|
| 254 |
|
---|
| 255 | <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
|
---|
| 256 | <para id="sg"><command>sg</command> executes a given command while the user's GID
|
---|
| 257 | is set to that of the given group.</para>
|
---|
| 258 |
|
---|
| 259 | <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
|
---|
| 260 | <para id="useradd"><command>useradd</command> creates a new user with the given name,
|
---|
| 261 | or updates the default new-user information.</para>
|
---|
| 262 |
|
---|
| 263 | <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
|
---|
| 264 | <para id="userdel"><command>userdel</command> deletes the given user account.</para>
|
---|
| 265 |
|
---|
| 266 | <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
|
---|
| 267 | <para id="usermod"><command>usermod</command> is used to modify the given user's
|
---|
| 268 | login name, UID (User Identification), shell, initial group, home directory, and the like.</para>
|
---|
| 269 |
|
---|
| 270 | <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
|
---|
| 271 | <para id="vigr"><command>vigr</command> can be used to edit the
|
---|
| 272 | <filename>/etc/group</filename> or <filename>/etc/gshadow</filename>
|
---|
| 273 | files.</para>
|
---|
| 274 |
|
---|
| 275 | <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
|
---|
| 276 | <para id="vipw"><command>vipw</command> can be used to edit the
|
---|
| 277 | <filename>/etc/passwd</filename> or <filename>/etc/shadow</filename>
|
---|
| 278 | files.</para>
|
---|
| 279 |
|
---|
| 280 | <indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
|
---|
| 281 | <para id="libmisc"><command>libmisc</command>...</para>
|
---|
| 282 |
|
---|
| 283 | <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
|
---|
| 284 | <para id="libshadow"><command>libshadow</command> contains functions used by most
|
---|
| 285 | programs in this package.</para>
|
---|
| 286 |
|
---|
| 287 | </sect2>
|
---|
| 288 |
|
---|
| 289 |
|
---|
| 290 |
|
---|
| 291 | </sect1>
|
---|