source: postlfs/security/sudo.xml@ 5a8c6008

11.3 12.0 12.1 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts lazarus lxqt plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since 5a8c6008 was 3f2db3a6, checked in by Pierre Labastie <pierre.labastie@…>, 18 months ago

Remove sect1info tags

They only contain a date tag that is nowhere used.

  • Property mode set to 100644
File size: 13.0 KB
Line 
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 "https://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 "486ebd8ff62a8671f609d9067b0dd79b">
10 <!ENTITY sudo-size "4.7 MB">
11 <!ENTITY sudo-buildsize "49 MB (add 16 MB for tests)">
12 <!ENTITY sudo-time "0.4 SBU (add 0.1 SBU for tests)">
13]>
14
15<sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
16 <?dbhtml filename="sudo.html"?>
17
18
19 <title>Sudo-&sudo-version;</title>
20
21 <indexterm zone="sudo">
22 <primary sortas="a-Sudo">Sudo</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to Sudo</title>
27
28 <para>
29 The <application>Sudo</application> package allows a system administrator
30 to give certain users (or groups of users) the ability to run
31 some (or all) commands as
32 <systemitem class="username">root</systemitem> or another user while
33 logging the commands and arguments.
34 </para>
35
36 &lfs112_checked;
37
38 <bridgehead renderas="sect3">Package Information</bridgehead>
39 <itemizedlist spacing="compact">
40 <listitem>
41 <para>
42 Download (HTTP): <ulink url="&sudo-download-http;"/>
43 </para>
44 </listitem>
45 <listitem>
46 <para>
47 Download (FTP): <ulink url="&sudo-download-ftp;"/>
48 </para>
49 </listitem>
50 <listitem>
51 <para>
52 Download MD5 sum: &sudo-md5sum;
53 </para>
54 </listitem>
55 <listitem>
56 <para>
57 Download size: &sudo-size;
58 </para>
59 </listitem>
60 <listitem>
61 <para>
62 Estimated disk space required: &sudo-buildsize;
63 </para>
64 </listitem>
65 <listitem>
66 <para>
67 Estimated build time: &sudo-time;
68 </para>
69 </listitem>
70 </itemizedlist>
71
72 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
73
74 <bridgehead renderas="sect4">Optional</bridgehead>
75 <para role="optional">
76 <xref linkend="linux-pam"/>,
77 <xref linkend="mitkrb"/>,
78 <xref linkend="openldap"/>,
79 <xref linkend="server-mail"/> (that provides a
80 <command>sendmail</command> command),
81 <ulink url="https://www.openafs.org/">AFS</ulink>,
82 <ulink url="https://www.fwtk.org/">FWTK</ulink>, and
83 <ulink url="&sourceforge-dl;/opie/">Opie</ulink>
84 </para>
85
86 <para condition="html" role="usernotes">User Notes:
87 <ulink url="&blfs-wiki;/sudo"/>
88 </para>
89 </sect2>
90
91 <sect2 role="installation">
92 <title>Installation of Sudo</title>
93
94 <para>
95 Install <application>Sudo</application> by running the following commands:
96 </para>
97
98<screen><userinput>./configure --prefix=/usr \
99 --libexecdir=/usr/lib \
100 --with-secure-path \
101 --with-all-insults \
102 --with-env-editor \
103 --docdir=/usr/share/doc/sudo-&sudo-version; \
104 --with-passprompt="[sudo] password for %p: " &amp;&amp;
105make</userinput></screen>
106
107 <para>
108 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
109 | tee make-check.log</command>. Check the results with <command>grep
110 failed make-check.log</command>.
111 </para>
112
113 <para>
114 Now, as the <systemitem class="username">root</systemitem> user:
115 </para>
116
117<screen role="root"><userinput>make install &amp;&amp;
118ln -sfv libsudo_util.so.0.0.0 /usr/lib/sudo/libsudo_util.so.0</userinput></screen>
119
120 </sect2>
121
122 <sect2 role="commands">
123 <title>Command Explanations</title>
124
125 <para>
126 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
127 private programs are installed. Everything in that directory is a library, so
128 they belong under <filename class="directory">/usr/lib</filename> instead of
129 <filename class="directory">/usr/libexec</filename>.
130 </para>
131
132 <para>
133 <parameter>--with-secure-path</parameter>: This switch transparently adds
134 <filename class="directory">/sbin</filename> and <filename
135 class="directory">/usr/sbin</filename> directories to the
136 <envar>PATH</envar> environment variable.
137 </para>
138
139 <para>
140 <parameter>--with-all-insults</parameter>: This switch includes all the
141 <application>sudo</application> insult sets.
142 </para>
143
144 <para>
145 <parameter>--with-env-editor</parameter>: This switch enables use of the
146 environment variable EDITOR for <command>visudo</command>.
147 </para>
148
149 <para>
150 <parameter>--with-passprompt</parameter>: This switch sets the password prompt.
151 The <parameter>%p</parameter> will be expanded to the name of the user whose password is being requested.
152 </para>
153
154 <para>
155 <option>--without-pam</option>: This switch avoids building
156 <application>Linux-PAM</application> support when
157 <application>Linux-PAM</application> is installed on the system.
158 </para>
159<!-- See the developer note above before the configure command
160 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
161 href="../../xincludes/static-libraries.xml"/>-->
162
163 <note>
164 <para>
165 There are many options to <application>sudo</application>'s
166 <command>configure</command> command. Check the
167 <command>configure --help</command> output for a complete list.
168 </para>
169 </note>
170
171 <para>
172 <command>ln -sfv libsudo_util...</command>: Works around a bug in the
173 installation process, which links to the previously installed
174 version (if there is one) instead of the new one.
175 </para>
176
177 </sect2>
178
179 <sect2 role="configuration">
180 <title>Configuring Sudo</title>
181
182 <sect3 id="sudo-config">
183 <title>Config File</title>
184
185 <para>
186 <filename>/etc/sudoers</filename>
187 </para>
188
189 <indexterm zone="sudo sudo-config">
190 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
191 </indexterm>
192
193 </sect3>
194
195 <sect3>
196 <title>Configuration Information</title>
197
198 <para>
199 The <filename>sudoers</filename> file can be quite complicated. It
200 is composed of two types of entries: aliases (basically variables) and
201 user specifications (which specify who may run what). The installation
202 installs a default configuration that has no privileges installed for
203 any user.
204 </para>
205
206 <para>
207 A couple of common configuration changes are to set the path for the
208 super user and to allow members of the wheel group to execute all
209 commands after providing their own credientials. Use the following
210 commands to create the <filename>/etc/sudoers.d/00-sudo</filename>
211 configuration file as the
212 <systemitem class="username">root</systemitem> user:
213 </para>
214
215<screen role="root"><userinput>cat &gt; /etc/sudoers.d/00-sudo &lt;&lt; "EOF"
216<literal>Defaults secure_path="/usr/sbin:/usr/bin"
217%wheel ALL=(ALL) ALL</literal>
218EOF</userinput></screen>
219
220 <note>
221 <para>
222 In very simple installations where there is only one user, it
223 may be easier to just edit the <filename>/etc/sudoers</filename>
224 file directly. In that case, the <varname>secure_path</varname>
225 entry may not be needed and using <command>sudo -E ...</command> can
226 import the non-privileged user's full environment into the
227 privileged session.
228 </para>
229
230 <para>
231 The files in the <filename class="directory">/etc/sudoers.d</filename>
232 directory are parsed in sorted lexical order. Be careful that entries
233 in an added file do not overwrite previous entries.
234 </para>
235 </note>
236
237 <para>
238 For details, see <command>man sudoers</command>.
239 </para>
240
241 <note>
242 <para>
243 The <application>Sudo</application> developers highly recommend
244 using the <command>visudo</command> program to edit the
245 <filename>sudoers</filename> file. This will provide basic sanity
246 checking like syntax parsing and file permission to avoid some
247 possible mistakes that could lead to a vulnerable configuration.
248 </para>
249 </note>
250
251 <para>
252 If <application>PAM</application> is installed on the system,
253 <application>Sudo</application> is built with
254 <application>PAM</application> support. In that case, issue the
255 following command as the <systemitem class="username">root</systemitem>
256 user to create the <application>PAM</application> configuration file:
257 </para>
258
259<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
260<literal># Begin /etc/pam.d/sudo
261
262# include the default auth settings
263auth include system-auth
264
265# include the default account settings
266account include system-account
267
268# Set default environment variables for the service user
269session required pam_env.so
270
271# include system session defaults
272session include system-session
273
274# End /etc/pam.d/sudo</literal>
275EOF
276chmod 644 /etc/pam.d/sudo</userinput></screen>
277
278 </sect3>
279
280 </sect2>
281
282 <sect2 role="content">
283 <title>Contents</title>
284
285 <segmentedlist>
286 <segtitle>Installed Programs</segtitle>
287 <segtitle>Installed Libraries</segtitle>
288 <segtitle>Installed Directories</segtitle>
289
290 <seglistitem>
291 <seg>
292 cvtsudoers, sudo, sudo_logsrvd, sudo_sendlog,
293 sudoedit (symlink), sudoreplay, and visudo
294 </seg>
295 <seg>
296 <!-- [pierre, September 25, 2020] except libsudo_util, the other
297 shared objects in /usr/lib/sudo look more like modules than
298 libraries. Leaving them now, and updating the list, but I think
299 they should not be listed. -->
300 audit_json.so, group_file.so, libsudo_util.so, sample_approval.so,
301 sudoers.so, sudo_noexec.so, and system_group.so
302 </seg>
303 <seg>
304 /etc/sudoers.d,
305 /usr/lib/sudo,
306 /usr/share/doc/sudo-&sudo-version;, and
307 /var/lib/sudo
308 </seg>
309 </seglistitem>
310 </segmentedlist>
311
312 <variablelist>
313 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
314 <?dbfo list-presentation="list"?>
315 <?dbhtml list-presentation="table"?>
316
317 <varlistentry id="cvtsudoers">
318 <term><command>cvtsudoers</command></term>
319 <listitem>
320 <para>
321 converts between sudoers file formats
322 </para>
323 <indexterm zone="sudo cvtsudoers">
324 <primary sortas="b-cvtsudoers">cvtsudoers</primary>
325 </indexterm>
326 </listitem>
327 </varlistentry>
328
329 <varlistentry id="sudo_prog">
330 <term><command>sudo</command></term>
331 <listitem>
332 <para>
333 executes a command as another user as permitted by
334 the <filename>/etc/sudoers</filename> configuration file
335 </para>
336 <indexterm zone="sudo sudo">
337 <primary sortas="b-sudo">sudo</primary>
338 </indexterm>
339 </listitem>
340 </varlistentry>
341
342 <varlistentry id="sudo_logsrvd">
343 <term><command>sudo_logsrvd</command></term>
344 <listitem>
345 <para>
346 is a sudo event and I/O log server
347 </para>
348 <indexterm zone="sudo sudo_logsrvd">
349 <primary sortas="b-sudo_logsrvd">sudo_logsrvd</primary>
350 </indexterm>
351 </listitem>
352 </varlistentry>
353
354 <varlistentry id="sudo_sendlog">
355 <term><command>sudo_sendlog</command></term>
356 <listitem>
357 <para>
358 sends sudo I/O logs to the log server
359 </para>
360 <indexterm zone="sudo sudo_sendlog">
361 <primary sortas="b-sudo_sendlog">sudo_sendlog</primary>
362 </indexterm>
363 </listitem>
364 </varlistentry>
365
366 <varlistentry id="sudoedit">
367 <term><command>sudoedit</command></term>
368 <listitem>
369 <para>
370 is a symlink to <command>sudo</command> that implies the
371 <option>-e</option> option to invoke an editor as another user
372 </para>
373 <indexterm zone="sudo sudoedit">
374 <primary sortas="b-sudoedit">sudoedit</primary>
375 </indexterm>
376 </listitem>
377 </varlistentry>
378
379 <varlistentry id="sudoreplay">
380 <term><command>sudoreplay</command></term>
381 <listitem>
382 <para>
383 is used to play back or list the output
384 logs created by <command>sudo</command>
385 </para>
386 <indexterm zone="sudo sudoreplay">
387 <primary sortas="b-sudoreplay">sudoreplay</primary>
388 </indexterm>
389 </listitem>
390 </varlistentry>
391
392 <varlistentry id="visudo">
393 <term><command>visudo</command></term>
394 <listitem>
395 <para>
396 allows for safer editing of the <filename>sudoers</filename>
397 file
398 </para>
399 <indexterm zone="sudo visudo">
400 <primary sortas="b-visudo">visudo</primary>
401 </indexterm>
402 </listitem>
403 </varlistentry>
404
405 </variablelist>
406
407 </sect2>
408
409</sect1>
Note: See TracBrowser for help on using the repository browser.