1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY sudo-download-http "http://www.sudo.ws/dist/sudo-&sudo-version;.tar.gz">
|
---|
8 | <!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
|
---|
9 | <!ENTITY sudo-md5sum "a977449587dc857e129bb20555b46af4">
|
---|
10 | <!ENTITY sudo-size "2.6 MB">
|
---|
11 | <!ENTITY sudo-buildsize "34 MB (with tests)">
|
---|
12 | <!ENTITY sudo-time "0.4 SBU (with tests)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
|
---|
16 | <?dbhtml filename="sudo.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | </sect1info>
|
---|
22 |
|
---|
23 | <title>Sudo-&sudo-version;</title>
|
---|
24 |
|
---|
25 | <indexterm zone="sudo">
|
---|
26 | <primary sortas="a-Sudo">Sudo</primary>
|
---|
27 | </indexterm>
|
---|
28 |
|
---|
29 | <sect2 role="package">
|
---|
30 | <title>Introduction to Sudo</title>
|
---|
31 |
|
---|
32 | <para>
|
---|
33 | The <application>Sudo</application> package allows a system administrator
|
---|
34 | to give certain users (or groups of users) the ability to run
|
---|
35 | some (or all) commands as
|
---|
36 | <systemitem class="username">root</systemitem> or another user while
|
---|
37 | logging the commands and arguments.
|
---|
38 | </para>
|
---|
39 |
|
---|
40 | &lfs79_checked;
|
---|
41 |
|
---|
42 | &gcc6_checked;
|
---|
43 |
|
---|
44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
45 | <itemizedlist spacing="compact">
|
---|
46 | <listitem>
|
---|
47 | <para>
|
---|
48 | Download (HTTP): <ulink url="&sudo-download-http;"/>
|
---|
49 | </para>
|
---|
50 | </listitem>
|
---|
51 | <listitem>
|
---|
52 | <para>
|
---|
53 | Download (FTP): <ulink url="&sudo-download-ftp;"/>
|
---|
54 | </para>
|
---|
55 | </listitem>
|
---|
56 | <listitem>
|
---|
57 | <para>
|
---|
58 | Download MD5 sum: &sudo-md5sum;
|
---|
59 | </para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>
|
---|
63 | Download size: &sudo-size;
|
---|
64 | </para>
|
---|
65 | </listitem>
|
---|
66 | <listitem>
|
---|
67 | <para>
|
---|
68 | Estimated disk space required: &sudo-buildsize;
|
---|
69 | </para>
|
---|
70 | </listitem>
|
---|
71 | <listitem>
|
---|
72 | <para>
|
---|
73 | Estimated build time: &sudo-time;
|
---|
74 | </para>
|
---|
75 | </listitem>
|
---|
76 | </itemizedlist>
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
|
---|
79 |
|
---|
80 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
81 | <para role="optional">
|
---|
82 | <xref linkend="linux-pam"/>,
|
---|
83 | <xref linkend="mitkrb"/>,
|
---|
84 | <xref linkend="openldap"/>,
|
---|
85 | <xref linkend="server-mail"/> (that provides a
|
---|
86 | <command>sendmail</command> command),
|
---|
87 | <ulink url="http://www.openafs.org/">AFS</ulink>,
|
---|
88 | <ulink url="http://www.fwtk.org/">FWTK</ulink>, and
|
---|
89 | <ulink url="http://sourceforge.net/projects/opie/files/">Opie</ulink>
|
---|
90 | <!-- <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink> -->
|
---|
91 | </para>
|
---|
92 |
|
---|
93 | <para condition="html" role="usernotes">User Notes:
|
---|
94 | <ulink url="&blfs-wiki;/sudo"/>
|
---|
95 | </para>
|
---|
96 | </sect2>
|
---|
97 |
|
---|
98 | <sect2 role="installation">
|
---|
99 | <title>Installation of Sudo</title>
|
---|
100 |
|
---|
101 | <para>
|
---|
102 | Install <application>Sudo</application> by running the following commands:
|
---|
103 | </para>
|
---|
104 |
|
---|
105 | <!-- Developer: apparently it is disabled by default, although in configure it
|
---|
106 | is written otherwise -disable-static \-->
|
---|
107 | <screen><userinput>./configure --prefix=/usr \
|
---|
108 | --libexecdir=/usr/lib \
|
---|
109 | --with-secure-path \
|
---|
110 | --with-all-insults \
|
---|
111 | --with-env-editor \
|
---|
112 | --docdir=/usr/share/doc/sudo-&sudo-version; \
|
---|
113 | --with-passprompt="[sudo] password for %p" &&
|
---|
114 | make</userinput></screen>
|
---|
115 |
|
---|
116 | <para>
|
---|
117 | To test the results, issue: <command>env LC_ALL=C make check 2>&1
|
---|
118 | | tee ../make-check.log</command>. Check the results with <command>grep
|
---|
119 | failed ../make-check.log</command>.
|
---|
120 | </para>
|
---|
121 |
|
---|
122 | <para>
|
---|
123 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
124 | </para>
|
---|
125 |
|
---|
126 | <screen role="root"><userinput>make install &&
|
---|
127 | ln -sfv libsudo_util.so.0.0.0 /usr/lib/sudo/libsudo_util.so.0</userinput></screen>
|
---|
128 |
|
---|
129 | </sect2>
|
---|
130 |
|
---|
131 | <sect2 role="commands">
|
---|
132 | <title>Command Explanations</title>
|
---|
133 |
|
---|
134 | <para>
|
---|
135 | <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
|
---|
136 | private programs are installed. Everything in that directory is a library, so
|
---|
137 | they belong under <filename class="directory">/usr/lib</filename> instead of
|
---|
138 | <filename class="directory">/usr/libexec</filename>.
|
---|
139 | </para>
|
---|
140 |
|
---|
141 | <para>
|
---|
142 | <parameter>--with-secure-path</parameter>: This switch transparently adds
|
---|
143 | <filename class="directory">/sbin</filename> and <filename
|
---|
144 | class="directory">/usr/sbin</filename> directories to the
|
---|
145 | <envar>PATH</envar> environment variable.
|
---|
146 | </para>
|
---|
147 |
|
---|
148 | <para>
|
---|
149 | <parameter>--with-all-insults</parameter>: This switch includes all the
|
---|
150 | <application>sudo</application> insult sets.
|
---|
151 | </para>
|
---|
152 |
|
---|
153 | <para>
|
---|
154 | <parameter>--with-env-editor</parameter>: This switch enables use of the
|
---|
155 | environment variable EDITOR for <command>visudo</command>.
|
---|
156 | </para>
|
---|
157 |
|
---|
158 | <para>
|
---|
159 | <parameter>--with-passprompt</parameter>: This switch sets the password prompt.
|
---|
160 | </para>
|
---|
161 |
|
---|
162 | <para>
|
---|
163 | <option>--without-pam</option>: This switch avoids building
|
---|
164 | <application>PAM</application> support when <application>PAM</application> is installed on the system.
|
---|
165 | </para>
|
---|
166 |
|
---|
167 | <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
|
---|
168 | href="../../xincludes/static-libraries.xml"/>
|
---|
169 |
|
---|
170 | <note>
|
---|
171 | <para>
|
---|
172 | There are many options to <application>sudo</application>'s
|
---|
173 | <command>configure</command> command. Check the
|
---|
174 | <command>configure --help</command> output for a complete list.
|
---|
175 | </para>
|
---|
176 | </note>
|
---|
177 |
|
---|
178 | <para>
|
---|
179 | <command>ln -sfv libsudo_util...</command>: Works around a bug in the
|
---|
180 | installation process, which links the versioned library to the
|
---|
181 | previously installed version (when present) instead of the new one.
|
---|
182 | </para>
|
---|
183 |
|
---|
184 | </sect2>
|
---|
185 |
|
---|
186 | <sect2 role="configuration">
|
---|
187 | <title>Configuring Sudo</title>
|
---|
188 |
|
---|
189 | <sect3 id="sudo-config">
|
---|
190 | <title>Config File</title>
|
---|
191 |
|
---|
192 | <para>
|
---|
193 | <filename>/etc/sudoers</filename>
|
---|
194 | </para>
|
---|
195 |
|
---|
196 | <indexterm zone="sudo sudo-config">
|
---|
197 | <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
|
---|
198 | </indexterm>
|
---|
199 |
|
---|
200 | </sect3>
|
---|
201 |
|
---|
202 | <sect3>
|
---|
203 | <title>Configuration Information</title>
|
---|
204 |
|
---|
205 | <para>
|
---|
206 | The <filename>sudoers</filename> file can be quite complicated. It
|
---|
207 | is composed of two types of entries: aliases (basically variables) and
|
---|
208 | user specifications (which specify who may run what). The installation
|
---|
209 | installs a default configuration that has no privileges installed for any
|
---|
210 | user.
|
---|
211 | </para>
|
---|
212 |
|
---|
213 | <para>
|
---|
214 | One example usage is to allow the system administrator to execute
|
---|
215 | any program without typing a password each time root privileges are
|
---|
216 | needed. This can be configured as:
|
---|
217 | </para>
|
---|
218 |
|
---|
219 | <screen># User alias specification
|
---|
220 | User_Alias ADMIN = YourLoginId
|
---|
221 |
|
---|
222 | # Allow people in group ADMIN to run all commands without a password
|
---|
223 | ADMIN ALL = NOPASSWD: ALL</screen>
|
---|
224 |
|
---|
225 | <para>
|
---|
226 | For details, see <command>man sudoers</command>.
|
---|
227 | </para>
|
---|
228 |
|
---|
229 | <note>
|
---|
230 | <para>
|
---|
231 | The <application>Sudo</application> developers highly recommend
|
---|
232 | using the <command>visudo</command> program to edit the
|
---|
233 | <filename>sudoers</filename> file. This will provide basic sanity
|
---|
234 | checking like syntax parsing and file permission to avoid some possible
|
---|
235 | mistakes that could lead to a vulnerable configuration.
|
---|
236 | </para>
|
---|
237 | </note>
|
---|
238 |
|
---|
239 | <para>
|
---|
240 | If <application>PAM</application> is installed on the system,
|
---|
241 | <application>Sudo</application> is built with
|
---|
242 | <application>PAM</application> support. In that case, issue the following
|
---|
243 | command as the <systemitem class="username">root</systemitem> user
|
---|
244 | to create the <application>PAM</application> configuration file:
|
---|
245 | </para>
|
---|
246 |
|
---|
247 | <screen role="root"><userinput>cat > /etc/pam.d/sudo << "EOF"
|
---|
248 | <literal># Begin /etc/pam.d/sudo
|
---|
249 |
|
---|
250 | # include the default auth settings
|
---|
251 | auth include system-auth
|
---|
252 |
|
---|
253 | # include the default account settings
|
---|
254 | account include system-account
|
---|
255 |
|
---|
256 | # Set default environment variables for the service user
|
---|
257 | session required pam_env.so
|
---|
258 |
|
---|
259 | # include system session defaults
|
---|
260 | session include system-session
|
---|
261 |
|
---|
262 | # End /etc/pam.d/sudo</literal>
|
---|
263 | EOF
|
---|
264 | chmod 644 /etc/pam.d/sudo</userinput></screen>
|
---|
265 |
|
---|
266 | </sect3>
|
---|
267 |
|
---|
268 | </sect2>
|
---|
269 |
|
---|
270 | <sect2 role="content">
|
---|
271 | <title>Contents</title>
|
---|
272 |
|
---|
273 | <segmentedlist>
|
---|
274 | <segtitle>Installed Programs</segtitle>
|
---|
275 | <segtitle>Installed Libraries</segtitle>
|
---|
276 | <segtitle>Installed Directories</segtitle>
|
---|
277 |
|
---|
278 | <seglistitem>
|
---|
279 | <seg>
|
---|
280 | sudo,
|
---|
281 | sudoedit (symlink),
|
---|
282 | sudoreplay,
|
---|
283 | and visudo
|
---|
284 | </seg>
|
---|
285 | <seg>
|
---|
286 | group_file.so,
|
---|
287 | libsudo_util.so,
|
---|
288 | sudoers.so,
|
---|
289 | sudo_noexec.so,
|
---|
290 | and system_group.so
|
---|
291 | </seg>
|
---|
292 | <seg>
|
---|
293 | /etc/sudoers.d,
|
---|
294 | /usr/lib/sudo,
|
---|
295 | /usr/share/doc/sudo-&sudo-version;,
|
---|
296 | /var/lib/sudo, and
|
---|
297 | /var/run/sudo
|
---|
298 | </seg>
|
---|
299 | </seglistitem>
|
---|
300 | </segmentedlist>
|
---|
301 |
|
---|
302 | <variablelist>
|
---|
303 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
304 | <?dbfo list-presentation="list"?>
|
---|
305 | <?dbhtml list-presentation="table"?>
|
---|
306 |
|
---|
307 | <varlistentry id="sudo_prog">
|
---|
308 | <term><command>sudo</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>
|
---|
311 | executes a command as another user as permitted by
|
---|
312 | the <filename>/etc/sudoers</filename> configuration file.
|
---|
313 | </para>
|
---|
314 | <indexterm zone="sudo sudo">
|
---|
315 | <primary sortas="b-sudo">sudo</primary>
|
---|
316 | </indexterm>
|
---|
317 | </listitem>
|
---|
318 | </varlistentry>
|
---|
319 |
|
---|
320 | <varlistentry id="sudoedit">
|
---|
321 | <term><command>sudoedit</command></term>
|
---|
322 | <listitem>
|
---|
323 | <para>
|
---|
324 | is a symlink to <command>sudo</command> that implies the
|
---|
325 | <option>-e</option> option to invoke an editor as another user.
|
---|
326 | </para>
|
---|
327 | <indexterm zone="sudo sudoedit">
|
---|
328 | <primary sortas="b-sudoedit">sudoedit</primary>
|
---|
329 | </indexterm>
|
---|
330 | </listitem>
|
---|
331 | </varlistentry>
|
---|
332 |
|
---|
333 | <varlistentry id="sudoreplay">
|
---|
334 | <term><command>sudoreplay</command></term>
|
---|
335 | <listitem>
|
---|
336 | <para>
|
---|
337 | is used to play back or list the output
|
---|
338 | logs created by <command>sudo</command>.
|
---|
339 | </para>
|
---|
340 | <indexterm zone="sudo sudoreplay">
|
---|
341 | <primary sortas="b-sudoreplay">sudoreplay</primary>
|
---|
342 | </indexterm>
|
---|
343 | </listitem>
|
---|
344 | </varlistentry>
|
---|
345 |
|
---|
346 | <varlistentry id="visudo">
|
---|
347 | <term><command>visudo</command></term>
|
---|
348 | <listitem>
|
---|
349 | <para>
|
---|
350 | allows for safer editing of the <filename>sudoers</filename>
|
---|
351 | file.
|
---|
352 | </para>
|
---|
353 | <indexterm zone="sudo visudo">
|
---|
354 | <primary sortas="b-visudo">visudo</primary>
|
---|
355 | </indexterm>
|
---|
356 | </listitem>
|
---|
357 | </varlistentry>
|
---|
358 |
|
---|
359 | </variablelist>
|
---|
360 |
|
---|
361 | </sect2>
|
---|
362 |
|
---|
363 | </sect1>
|
---|