source: postlfs/security/sudo.xml@ a16884c0

12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18
Last change on this file since a16884c0 was e1e58be, checked in by Pierre Labastie <pierre.labastie@…>, 9 months ago

Remove all ftp urls

neither firefox nor epiphany can download them, and they are not
well maintained, because rarely tested.
This is WIP because the "(HTTP)" part of "Download (HTTP)" will
need to be removed too.
But let's see what users think first...

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