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 | ]>
|
---|
6 | <sect1 id="ch-system-shadow" xreflabel="Shadow">
|
---|
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>
|
---|
11 |
|
---|
12 | <para>The Shadow package contains programs for handling passwords in a secure
|
---|
13 | way.</para>
|
---|
14 |
|
---|
15 | <screen>&buildtime; 0.4 SBU
|
---|
16 | &diskspace; 11 MB</screen>
|
---|
17 |
|
---|
18 | <para>Shadow installation depends on: Bash, Binutils, Bison, Coreutils,
|
---|
19 | Diffutils, GCC, Gettext, Glibc, Grep, Make, Sed.</para>
|
---|
20 |
|
---|
21 |
|
---|
22 |
|
---|
23 | <sect2>
|
---|
24 | <title>Installation of Shadow</title>
|
---|
25 |
|
---|
26 | <para>Shadow hard-wires the path to the <command>passwd</command> binary within
|
---|
27 | the binary itself, but does this the wrong way. If a <command>passwd</command>
|
---|
28 | binary is not present before installing Shadow, the package incorrectly assumes
|
---|
29 | it is going to be located at <filename>/bin/passwd</filename>, but then
|
---|
30 | installs it as <filename>/usr/bin/passwd</filename>. This will lead to errors
|
---|
31 | about not finding <filename>/bin/passwd</filename>. To work around this bug,
|
---|
32 | create a dummy <filename>passwd</filename> file, so that it gets hard-wired
|
---|
33 | properly:</para>
|
---|
34 |
|
---|
35 | <screen><userinput>touch /usr/bin/passwd</userinput></screen>
|
---|
36 |
|
---|
37 | <para>Now prepare Shadow for compilation:</para>
|
---|
38 |
|
---|
39 | <screen><userinput>./configure --libdir=/usr/lib --enable-shared</userinput></screen>
|
---|
40 |
|
---|
41 | <para>Work around a problem that prevents Shadow's internationalization from
|
---|
42 | working:</para>
|
---|
43 |
|
---|
44 | <screen><userinput>echo '#define HAVE_SETLOCALE 1' >> config.h</userinput></screen>
|
---|
45 |
|
---|
46 | <para>Compile the package:</para>
|
---|
47 |
|
---|
48 | <screen><userinput>make</userinput></screen>
|
---|
49 |
|
---|
50 | <para>Then install it:</para>
|
---|
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 |
|
---|
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,
|
---|
61 | which also allows passwords longer than 8 characters. We also need to
|
---|
62 | change the obsolete <filename class="directory">/var/spool/mail</filename>
|
---|
63 | location for user mailboxes that Shadow uses by default to the <filename
|
---|
64 | class="directory">/var/mail</filename> location used currently. We accomplish
|
---|
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%' \
|
---|
70 | -e 's%/var/spool/mail%/var/mail%' \
|
---|
71 | etc/login.defs.linux > /etc/login.defs</userinput></screen>
|
---|
72 |
|
---|
73 | <para>Move some misplaced symlinks to their proper locations:</para>
|
---|
74 |
|
---|
75 | <screen><userinput>mv /bin/sg /usr/bin
|
---|
76 | mv /bin/vigr /usr/sbin</userinput></screen>
|
---|
77 |
|
---|
78 | <para>And move Shadow's dynamic libraries to a more appropriate location:</para>
|
---|
79 |
|
---|
80 | <screen><userinput>mv /usr/lib/lib{shadow,misc}.so.0* /lib</userinput></screen>
|
---|
81 |
|
---|
82 | <para>As some packages expect to find the just-moved libraries in
|
---|
83 | <filename>/usr/lib</filename>, create the following symlinks:</para>
|
---|
84 |
|
---|
85 | <screen><userinput>ln -sf ../../lib/libshadow.so.0 /usr/lib/libshadow.so
|
---|
86 | ln -sf ../../lib/libmisc.so.0 /usr/lib/libmisc.so</userinput></screen>
|
---|
87 |
|
---|
88 | <para>The -D option of the <filename>useradd</filename> program requires this
|
---|
89 | directory for it to work properly:</para>
|
---|
90 |
|
---|
91 | <screen><userinput>mkdir /etc/default</userinput></screen>
|
---|
92 |
|
---|
93 | <para>Coreutils has already installed a better <command>groups</command>
|
---|
94 | program in <filename class="directory">/usr/bin</filename>. Remove the one
|
---|
95 | installed by Shadow:</para>
|
---|
96 |
|
---|
97 | <screen><userinput>rm /bin/groups</userinput></screen>
|
---|
98 |
|
---|
99 | </sect2>
|
---|
100 |
|
---|
101 |
|
---|
102 | <sect2 id="conf-shadow"><title>Configuring Shadow</title>
|
---|
103 | <indexterm zone="conf-shadow">
|
---|
104 | <primary sortas="a-Shadow">Shadow</primary>
|
---|
105 | <secondary>configuring</secondary></indexterm>
|
---|
106 |
|
---|
107 | <para>This package contains utilities to add, modify and delete users and
|
---|
108 | groups, set and change their passwords, and other such administrative tasks.
|
---|
109 | For a full explanation of what <emphasis>password shadowing</emphasis> means,
|
---|
110 | see the <filename>doc/HOWTO</filename> file within the unpacked source tree.
|
---|
111 | There's one thing to keep in mind if you decide to use Shadow support: programs
|
---|
112 | that need to verify passwords (display managers, ftp programs, pop3 daemons,
|
---|
113 | and the like) need to be <emphasis>shadow-compliant</emphasis>, that is they
|
---|
114 | need to be able to work with shadowed passwords.</para>
|
---|
115 |
|
---|
116 | <para>To enable shadowed passwords, run the following command:</para>
|
---|
117 |
|
---|
118 | <screen><userinput>pwconv</userinput></screen>
|
---|
119 |
|
---|
120 | <para>To enable shadowed group passwords, run:</para>
|
---|
121 |
|
---|
122 | <screen><userinput>grpconv</userinput></screen>
|
---|
123 |
|
---|
124 | <para>Under normal circumstances, you won't have created any passwords yet.
|
---|
125 | However, if returning to this section later to enable shadowing, you should
|
---|
126 | reset any current user passwords with the <command>passwd</command> command or
|
---|
127 | any group passwords with the <command>gpasswd</command> command.</para>
|
---|
128 |
|
---|
129 | </sect2>
|
---|
130 |
|
---|
131 |
|
---|
132 | <sect2>
|
---|
133 | <title>Setting the root password</title>
|
---|
134 |
|
---|
135 | <para>Choose a password for user root and set it via:</para>
|
---|
136 |
|
---|
137 | <screen><userinput>passwd root</userinput></screen>
|
---|
138 |
|
---|
139 | </sect2>
|
---|
140 |
|
---|
141 |
|
---|
142 | <sect2 id="contents-shadow"><title>Contents of Shadow</title>
|
---|
143 |
|
---|
144 | <para><emphasis>Installed programs</emphasis>: chage, chfn, chpasswd, chsh,
|
---|
145 | dpasswd, expiry, faillog, gpasswd, groupadd, groupdel, groupmod, groups, grpck,
|
---|
146 | grpconv, grpunconv, lastlog, login, logoutd, mkpasswd, newgrp, newusers,
|
---|
147 | passwd, pwck, pwconv, pwunconv, sg (link to newgrp), useradd, userdel, usermod,
|
---|
148 | vigr (link to vipw) and vipw</para>
|
---|
149 |
|
---|
150 | </sect2>
|
---|
151 |
|
---|
152 | <sect2><title>Short descriptions</title>
|
---|
153 |
|
---|
154 | <indexterm zone="ch-system-shadow chage"><primary sortas="b-chage">chage</primary></indexterm>
|
---|
155 | <para id="chage"><command>chage</command> is used to change the maximum number of
|
---|
156 | days between obligatory password changes.</para>
|
---|
157 |
|
---|
158 | <indexterm zone="ch-system-shadow chfn"><primary sortas="b-chfn">chfn</primary></indexterm>
|
---|
159 | <para id="chfn"><command>chfn</command> is used to change a user's full name and
|
---|
160 | some other info.</para>
|
---|
161 |
|
---|
162 | <indexterm zone="ch-system-shadow chpasswd"><primary sortas="b-chpasswd">chpasswd</primary></indexterm>
|
---|
163 | <para id="chpasswd"><command>chpasswd</command> is used to update the passwords of a
|
---|
164 | whole series of user accounts in one go.</para>
|
---|
165 |
|
---|
166 | <indexterm zone="ch-system-shadow chsh"><primary sortas="b-chsh">chsh</primary></indexterm>
|
---|
167 | <para id="chsh"><command>chsh</command> is used to change a user's default
|
---|
168 | login shell.</para>
|
---|
169 |
|
---|
170 | <indexterm zone="ch-system-shadow dpasswd"><primary sortas="b-dpasswd">dpasswd</primary></indexterm>
|
---|
171 | <para id="dpasswd"><command>dpasswd</command> is used to change dial-up passwords for
|
---|
172 | user login shells.</para>
|
---|
173 |
|
---|
174 | <indexterm zone="ch-system-shadow expiry"><primary sortas="b-expiry">expiry</primary></indexterm>
|
---|
175 | <para id="expiry"><command>expiry</command> checks and enforces the current password
|
---|
176 | expiration policy.</para>
|
---|
177 |
|
---|
178 | <indexterm zone="ch-system-shadow faillog"><primary sortas="b-faillog">faillog</primary></indexterm>
|
---|
179 | <para id="faillog"><command>faillog</command> is used to examine the log of login
|
---|
180 | failures, to set a maximum number of failures before an account is blocked,
|
---|
181 | or to reset the failure count.</para>
|
---|
182 |
|
---|
183 | <indexterm zone="ch-system-shadow gpasswd"><primary sortas="b-gpasswd">gpasswd</primary></indexterm>
|
---|
184 | <para id="gpasswd"><command>gpasswd</command> is used to add and delete members and
|
---|
185 | administrators to groups.</para>
|
---|
186 |
|
---|
187 | <indexterm zone="ch-system-shadow groupadd"><primary sortas="b-groupadd">groupadd</primary></indexterm>
|
---|
188 | <para id="groupadd"><command>groupadd</command> creates a group with the given
|
---|
189 | name.</para>
|
---|
190 |
|
---|
191 | <indexterm zone="ch-system-shadow groupdel"><primary sortas="b-groupdel">groupdel</primary></indexterm>
|
---|
192 | <para id="groupdel"><command>groupdel</command> deletes the group with the given
|
---|
193 | name.</para>
|
---|
194 |
|
---|
195 | <indexterm zone="ch-system-shadow groupmod"><primary sortas="b-groupmod">groupmod</primary></indexterm>
|
---|
196 | <para id="groupmod"><command>groupmod</command> is used to modify the given group's
|
---|
197 | name or GID.</para>
|
---|
198 |
|
---|
199 | <indexterm zone="ch-system-shadow groups"><primary sortas="b-groups">groups</primary></indexterm>
|
---|
200 | <para id="groups"><command>groups</command> reports the groups of which the given
|
---|
201 | users are members.</para>
|
---|
202 |
|
---|
203 | <indexterm zone="ch-system-shadow grpck"><primary sortas="b-grpck">grpck</primary></indexterm>
|
---|
204 | <para id="grpck"><command>grpck</command> verifies the integrity of the group files,
|
---|
205 | <filename>/etc/group</filename> and <filename>/etc/gshadow</filename>.</para>
|
---|
206 |
|
---|
207 | <indexterm zone="ch-system-shadow grpconv"><primary sortas="b-grpconv">grpconv</primary></indexterm>
|
---|
208 | <para id="grpconv"><command>grpconv</command> creates or updates the shadow group file
|
---|
209 | from the normal group file.</para>
|
---|
210 |
|
---|
211 | <indexterm zone="ch-system-shadow grpunconv"><primary sortas="b-grpunconv">grpunconv</primary></indexterm>
|
---|
212 | <para id="grpunconv"><command>grpunconv</command> updates <filename>/etc/group</filename>
|
---|
213 | from <filename>/etc/gshadow</filename> and then deletes the latter.</para>
|
---|
214 |
|
---|
215 | <indexterm zone="ch-system-shadow lastlog"><primary sortas="b-lastlog">lastlog</primary></indexterm>
|
---|
216 | <para id="lastlog"><command>lastlog</command> reports the most recent login of all
|
---|
217 | users, or of a given user.</para>
|
---|
218 |
|
---|
219 | <indexterm zone="ch-system-shadow login"><primary sortas="b-login">login</primary></indexterm>
|
---|
220 | <para id="login"><command>login</command> is used by the system to let users sign on.</para>
|
---|
221 |
|
---|
222 | <indexterm zone="ch-system-shadow logoutd"><primary sortas="b-logoutd">logoutd</primary></indexterm>
|
---|
223 | <para id="logoutd"><command>logoutd</command> is a daemon used to enforce restrictions
|
---|
224 | on log-on time and ports.</para>
|
---|
225 |
|
---|
226 | <indexterm zone="ch-system-shadow mkpasswd"><primary sortas="b-mkpasswd">mkpasswd</primary></indexterm>
|
---|
227 | <para id="mkpasswd"><command>mkpasswd</command> encrypts the given password using the
|
---|
228 | also given perturbation.</para>
|
---|
229 |
|
---|
230 | <indexterm zone="ch-system-shadow newgrp"><primary sortas="b-newgrp">newgrp</primary></indexterm>
|
---|
231 | <para id="newgrp"><command>newgrp</command> is used to change the current GID during
|
---|
232 | a login session.</para>
|
---|
233 |
|
---|
234 | <indexterm zone="ch-system-shadow newusers"><primary sortas="b-newusers">newusers</primary></indexterm>
|
---|
235 | <para id="newusers"><command>newusers</command> is used to create or update a whole
|
---|
236 | series of user accounts in one go.</para>
|
---|
237 |
|
---|
238 | <indexterm zone="ch-system-shadow passwd"><primary sortas="b-passwd">passwd</primary></indexterm>
|
---|
239 | <para id="passwd"><command>passwd</command> is used to change the password for a user
|
---|
240 | or group account.</para>
|
---|
241 |
|
---|
242 | <indexterm zone="ch-system-shadow pwck"><primary sortas="b-pwck">pwck</primary></indexterm>
|
---|
243 | <para id="pwck"><command>pwck</command> verifies the integrity of the password files,
|
---|
244 | <filename>/etc/passwd</filename> and <filename>/etc/shadow</filename>.</para>
|
---|
245 |
|
---|
246 | <indexterm zone="ch-system-shadow pwconv"><primary sortas="b-pwconv">pwconv</primary></indexterm>
|
---|
247 | <para id="pwconv"><command>pwconv</command> creates or updates the shadow password file
|
---|
248 | from the normal password file.</para>
|
---|
249 |
|
---|
250 | <indexterm zone="ch-system-shadow pwunconv"><primary sortas="b-pwunconv">pwunconv</primary></indexterm>
|
---|
251 | <para id="pwunconv"><command>pwunconv</command> updates <filename>/etc/passwd</filename>
|
---|
252 | from <filename>/etc/shadow</filename> and then deletes the latter.</para>
|
---|
253 |
|
---|
254 | <indexterm zone="ch-system-shadow sg"><primary sortas="b-sg">sg</primary></indexterm>
|
---|
255 | <para id="sg"><command>sg</command> executes a given command while the user's GID
|
---|
256 | is set to that of the given group.</para>
|
---|
257 |
|
---|
258 | <indexterm zone="ch-system-shadow useradd"><primary sortas="b-useradd">useradd</primary></indexterm>
|
---|
259 | <para id="useradd"><command>useradd</command> creates a new user with the given name,
|
---|
260 | or updates the default new-user information.</para>
|
---|
261 |
|
---|
262 | <indexterm zone="ch-system-shadow userdel"><primary sortas="b-userdel">userdel</primary></indexterm>
|
---|
263 | <para id="userdel"><command>userdel</command> deletes the given user account.</para>
|
---|
264 |
|
---|
265 | <indexterm zone="ch-system-shadow usermod"><primary sortas="b-usermod">usermod</primary></indexterm>
|
---|
266 | <para id="usermod"><command>usermod</command> is used to modify the given user's
|
---|
267 | login name, UID (User Identification), shell, initial group, home directory, and the like.</para>
|
---|
268 |
|
---|
269 | <indexterm zone="ch-system-shadow vigr"><primary sortas="b-vigr">vigr</primary></indexterm>
|
---|
270 | <para id="vigr"><command>vigr</command> can be used to edit the
|
---|
271 | <filename>/etc/group</filename> or <filename>/etc/gshadow</filename>
|
---|
272 | files.</para>
|
---|
273 |
|
---|
274 | <indexterm zone="ch-system-shadow vipw"><primary sortas="b-vipw">vipw</primary></indexterm>
|
---|
275 | <para id="vipw"><command>vipw</command> can be used to edit the
|
---|
276 | <filename>/etc/passwd</filename> or <filename>/etc/shadow</filename>
|
---|
277 | files.</para>
|
---|
278 |
|
---|
279 | <indexterm zone="ch-system-shadow libmisc"><primary sortas="c-libmisc">libmisc</primary></indexterm>
|
---|
280 | <para id="libmisc"><command>libmisc</command>...</para>
|
---|
281 |
|
---|
282 | <indexterm zone="ch-system-shadow libshadow"><primary sortas="c-libshadow">libshadow</primary></indexterm>
|
---|
283 | <para id="libshadow"><command>libshadow</command> contains functions used by most
|
---|
284 | programs in this package.</para>
|
---|
285 |
|
---|
286 | </sect2>
|
---|
287 |
|
---|
288 |
|
---|
289 |
|
---|
290 | </sect1>
|
---|