source: postlfs/security/sudo.xml@ ce5616c

10.1 11.0 11.1 11.2 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 upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since ce5616c was ce5616c, checked in by Bruce Dubbs <bdubbs@…>, 3 years ago

Update to sudo-1.9.4.
Update to feh-3.6.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@23947 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 13.6 KB
RevLine 
[cf341b4]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[cf341b4]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[06915b3]7 <!ENTITY sudo-download-http "http://www.sudo.ws/dist/sudo-&sudo-version;.tar.gz">
[926d146d]8 <!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
[ce5616c]9 <!ENTITY sudo-md5sum "b654699baebedd095fa525108ea12cbe">
[60896f7]10 <!ENTITY sudo-size "3.8 MB">
[ce5616c]11 <!ENTITY sudo-buildsize "41 MB (add 9 MB for tests)">
[a82b5f44]12 <!ENTITY sudo-time "0.4 SBU (add 0.1 SBU for tests)">
[cf341b4]13]>
14
[bcd2922]15<sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
[cf341b4]16 <?dbhtml filename="sudo.html"?>
17
18 <sect1info>
[e19ad480]19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
[cf341b4]21 </sect1info>
22
23 <title>Sudo-&sudo-version;</title>
24
25 <indexterm zone="sudo">
[bcd2922]26 <primary sortas="a-Sudo">Sudo</primary>
[cf341b4]27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Sudo</title>
31
[bcd2922]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>
[cf341b4]39
[b3caf56]40 &lfs10_checked;
[a8d3d55a]41
[cf341b4]42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
[bcd2922]45 <para>
46 Download (HTTP): <ulink url="&sudo-download-http;"/>
47 </para>
[cf341b4]48 </listitem>
49 <listitem>
[bcd2922]50 <para>
51 Download (FTP): <ulink url="&sudo-download-ftp;"/>
52 </para>
[cf341b4]53 </listitem>
54 <listitem>
[bcd2922]55 <para>
56 Download MD5 sum: &sudo-md5sum;
57 </para>
[cf341b4]58 </listitem>
59 <listitem>
[bcd2922]60 <para>
61 Download size: &sudo-size;
62 </para>
[cf341b4]63 </listitem>
64 <listitem>
[bcd2922]65 <para>
66 Estimated disk space required: &sudo-buildsize;
67 </para>
[cf341b4]68 </listitem>
69 <listitem>
[bcd2922]70 <para>
71 Estimated build time: &sudo-time;
72 </para>
[cf341b4]73 </listitem>
74 </itemizedlist>
75
[ce5616c]76 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
77 <itemizedlist spacing="compact">
78 <listitem>
79 <para>
80 Required patch to fix issues when not using sendmail:
81 <ulink url="&patch-root;/sudo-&sudo-version;-upstream_fix-1.patch"/>
82 </para>
83 </listitem>
84 </itemizedlist>
85
86
87
[cf341b4]88 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
89
90 <bridgehead renderas="sect4">Optional</bridgehead>
[bcd2922]91 <para role="optional">
92 <xref linkend="linux-pam"/>,
93 <xref linkend="mitkrb"/>,
94 <xref linkend="openldap"/>,
[6b4f8529]95 <xref linkend="server-mail"/> (that provides a
96 <command>sendmail</command> command),
97 <ulink url="http://www.openafs.org/">AFS</ulink>,
[06915b3]98 <ulink url="http://www.fwtk.org/">FWTK</ulink>, and
[8dfc5c3]99 <ulink url="&sourceforge-dl;/opie/">Opie</ulink>
[06915b3]100<!-- <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>-->
[bcd2922]101 </para>
[b35e86b2]102
[3597eb6]103 <para condition="html" role="usernotes">User Notes:
[bcd2922]104 <ulink url="&blfs-wiki;/sudo"/>
105 </para>
[cf341b4]106 </sect2>
107
108 <sect2 role="installation">
109 <title>Installation of Sudo</title>
110
[51c7b851]111<!-- To my understanding, the Makefile.in does test on readable
112 $(sudoersdir)/sudoers anyhow. This sed seems to be redundant.
113
[0f79af41]114 <para>
115 First, fix a problem that prevents installation from completion:
116 </para>
117
118<screen><userinput>sed -e '/^pre-install:/{N;s@;@ -a -r $(sudoersdir)/sudoers;@}' \
119 -i plugins/sudoers/Makefile.in</userinput></screen>
[51c7b851]120-->
[ce5616c]121
122 <para>First, fix a bug identified upstream:</para>
123
124<screen><userinput>patch -Np1 -i ../sudo-&sudo-version;-upstream_fix-1.patch</userinput></screen>
125
[bcd2922]126 <para>
[6e5d584]127 Install <application>Sudo</application> by running the following commands:
[bcd2922]128 </para>
[cf341b4]129
[1c69133]130<!-- Developer: apparently it is disabled by default, although in configure it
131is written otherwise -disable-static \-->
[b9d56ad4]132<screen><userinput>./configure --prefix=/usr \
[edaee95]133 --libexecdir=/usr/lib \
[1a657ca]134 --with-secure-path \
[b9d56ad4]135 --with-all-insults \
136 --with-env-editor \
137 --docdir=/usr/share/doc/sudo-&sudo-version; \
[9dabcf3]138 --with-passprompt="[sudo] password for %p: " &amp;&amp;
[cf341b4]139make</userinput></screen>
140
[bcd2922]141 <para>
[6b4f8529]142 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
143 | tee ../make-check.log</command>. Check the results with <command>grep
[035fb89]144 failed ../make-check.log</command>. <!--One test, test3, is known to fail
145 if the tests are run as the root user.-->
[bcd2922]146 </para>
[21755bc]147
[bcd2922]148 <para>
149 Now, as the <systemitem class="username">root</systemitem> user:
150 </para>
[cf341b4]151
[2809c8c]152<screen role="root"><userinput>make install &amp;&amp;
153ln -sfv libsudo_util.so.0.0.0 /usr/lib/sudo/libsudo_util.so.0</userinput></screen>
[cf341b4]154
155 </sect2>
156
157 <sect2 role="commands">
158 <title>Command Explanations</title>
159
[663b79c2]160 <para>
[edaee95]161 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
[663b79c2]162 private programs are installed. Everything in that directory is a library, so
163 they belong under <filename class="directory">/usr/lib</filename> instead of
164 <filename class="directory">/usr/libexec</filename>.
[8466229]165 </para>
166
167 <para>
168 <parameter>--with-secure-path</parameter>: This switch transparently adds
169 <filename class="directory">/sbin</filename> and <filename
170 class="directory">/usr/sbin</filename> directories to the
171 <envar>PATH</envar> environment variable.
[663b79c2]172 </para>
173
[bcd2922]174 <para>
[f3d174f]175 <parameter>--with-all-insults</parameter>: This switch includes all the
[bcd2922]176 <application>sudo</application> insult sets.
177 </para>
[cf341b4]178
[bcd2922]179 <para>
[f3d174f]180 <parameter>--with-env-editor</parameter>: This switch enables use of the
[bcd2922]181 environment variable EDITOR for <command>visudo</command>.
182 </para>
[8890b85f]183
[f3d174f]184 <para>
[ecea644]185 <parameter>--with-passprompt</parameter>: This switch sets the password prompt.
[7f99ddf]186 The <parameter>%p</parameter> will be expanded to the name of the user whose password is being requested.
[f3d174f]187 </para>
188
[14c71e0]189 <para>
[f586237]190 <option>--without-pam</option>: This switch avoids building
191 <application>Linux-PAM</application> support when
192 <application>Linux-PAM</application> is installed on the system.
[14c71e0]193 </para>
[17b685f1]194<!-- See the developer note above before the configure command
[b9d56ad4]195 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[f1d7196]196 href="../../xincludes/static-libraries.xml"/>-->
[b9d56ad4]197
[33d90fe]198 <note>
[bcd2922]199 <para>
200 There are many options to <application>sudo</application>'s
201 <command>configure</command> command. Check the
202 <command>configure --help</command> output for a complete list.
203 </para>
[33d90fe]204 </note>
[cf341b4]205
[2809c8c]206 <para>
[f586237]207 <command>ln -sfv libsudo_util...</command>: Works around a bug in the
[2809c8c]208 installation process, which links to the previously installed
209 version (if there is one) instead of the new one.
210 </para>
211
[cf341b4]212 </sect2>
213
214 <sect2 role="configuration">
215 <title>Configuring Sudo</title>
216
217 <sect3 id="sudo-config">
218 <title>Config File</title>
219
[7a47afc]220 <para>
221 <filename>/etc/sudoers</filename>
222 </para>
[cf341b4]223
224 <indexterm zone="sudo sudo-config">
225 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
226 </indexterm>
227
228 </sect3>
229
230 <sect3>
231 <title>Configuration Information</title>
232
[bcd2922]233 <para>
234 The <filename>sudoers</filename> file can be quite complicated. It
235 is composed of two types of entries: aliases (basically variables) and
236 user specifications (which specify who may run what). The installation
[b4c31a6]237 installs a default configuration that has no privileges installed for
238 any user.
[bcd2922]239 </para>
[bccbdaea]240
[a5b9f1e]241 <para>
[77b64bd]242 A couple of common configuration chanes are to set the path for the
243 super user and to allow members of the wheel group to execute all
244 commands after providing their own credientials. Use the following
245 commands to create the <filename>/etc/sudoers.d/sudo</filename>
246 configuration file as the
247 <systemitem class="username">root</systemitem> user:
[a5b9f1e]248 </para>
249
[77b64bd]250<screen role="root"><userinput>cat &gt; /etc/sudoers.d/sudo &lt;&lt; "EOF"
251<literal>Defaults secure_path="/usr/bin:/bin:/usr/sbin:/sbin"
252%wheel ALL=(ALL) ALL</literal>
253EOF</userinput></screen>
[a5b9f1e]254
[bcd2922]255 <para>
256 For details, see <command>man sudoers</command>.
257 </para>
[cf341b4]258
[3c0f868f]259 <note>
[bcd2922]260 <para>
261 The <application>Sudo</application> developers highly recommend
262 using the <command>visudo</command> program to edit the
263 <filename>sudoers</filename> file. This will provide basic sanity
[b4c31a6]264 checking like syntax parsing and file permission to avoid some
265 possible mistakes that could lead to a vulnerable configuration.
[bcd2922]266 </para>
[3c0f868f]267 </note>
268
[bcd2922]269 <para>
[14c71e0]270 If <application>PAM</application> is installed on the system,
271 <application>Sudo</application> is built with
[b4c31a6]272 <application>PAM</application> support. In that case, issue the
273 following command as the <systemitem class="username">root</systemitem>
274 user to create the <application>PAM</application> configuration file:
[bcd2922]275 </para>
[8890b85f]276
[add8d4f]277<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
278<literal># Begin /etc/pam.d/sudo
[b3a4f60]279
280# include the default auth settings
281auth include system-auth
282
283# include the default account settings
284account include system-account
285
286# Set default environment variables for the service user
287session required pam_env.so
288
289# include system session defaults
290session include system-session
291
[add8d4f]292# End /etc/pam.d/sudo</literal>
[b3a4f60]293EOF
294chmod 644 /etc/pam.d/sudo</userinput></screen>
[fd7e0ed6]295
[cf341b4]296 </sect3>
297
298 </sect2>
299
300 <sect2 role="content">
301 <title>Contents</title>
302
303 <segmentedlist>
304 <segtitle>Installed Programs</segtitle>
[9d53187]305 <segtitle>Installed Libraries</segtitle>
[cf341b4]306 <segtitle>Installed Directories</segtitle>
307
308 <seglistitem>
[bcd2922]309 <seg>
[a82b5f44]310 cvtsudoers, sudo, sudo_logsrvd, sudo_sendlog,
311 sudoedit (symlink), sudoreplay, and visudo
[bcd2922]312 </seg>
313 <seg>
[a82b5f44]314 <!-- [pierre, September 25, 2020] except libsudo_util, the other
315 shared objects in /usr/lib/sudo look more like modules than
316 libraries. Leaving them now, and updating the list, but I think
317 they should not be listed. -->
318 audit_json.so, group_file.so, libsudo_util.so, sample_approval.so,
[6b4f8529]319 sudoers.so, sudo_noexec.so, and system_group.so
[bcd2922]320 </seg>
321 <seg>
[7a47afc]322 /etc/sudoers.d,
[b378aa0]323 /usr/lib/sudo,
[06915b3]324 /usr/share/doc/sudo-&sudo-version;, and
[a82b5f44]325 /var/lib/sudo
[bcd2922]326 </seg>
[cf341b4]327 </seglistitem>
328 </segmentedlist>
329
330 <variablelist>
331 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
332 <?dbfo list-presentation="list"?>
333 <?dbhtml list-presentation="table"?>
334
[d7bbb40]335 <varlistentry id="cvtsudoers">
336 <term><command>cvtsudoers</command></term>
337 <listitem>
338 <para>
339 converts between sudoers file formats.
340 </para>
341 <indexterm zone="sudo cvtsudoers">
342 <primary sortas="b-cvtsudoers">cvtsudoers</primary>
343 </indexterm>
344 </listitem>
345 </varlistentry>
346
[cf341b4]347 <varlistentry id="sudo_prog">
348 <term><command>sudo</command></term>
349 <listitem>
[bcd2922]350 <para>
351 executes a command as another user as permitted by
352 the <filename>/etc/sudoers</filename> configuration file.
[cf341b4]353 </para>
354 <indexterm zone="sudo sudo">
355 <primary sortas="b-sudo">sudo</primary>
356 </indexterm>
357 </listitem>
358 </varlistentry>
359
[a82b5f44]360 <varlistentry id="sudo_logsrvd">
361 <term><command>sudo_logsrvd</command></term>
362 <listitem>
363 <para>
364 is a sudo event and I/O log server.
365 </para>
366 <indexterm zone="sudo sudo_logsrvd">
367 <primary sortas="b-sudo_logsrvd">sudo_logsrvd</primary>
368 </indexterm>
369 </listitem>
370 </varlistentry>
371
372 <varlistentry id="sudo_sendlog">
373 <term><command>sudo_sendlog</command></term>
374 <listitem>
375 <para>
376 sends sudo I/O log to the log server.
377 </para>
378 <indexterm zone="sudo sudo_sendlog">
379 <primary sortas="b-sudo_sendlog">sudo_sendlog</primary>
380 </indexterm>
381 </listitem>
382 </varlistentry>
383
[cf341b4]384 <varlistentry id="sudoedit">
385 <term><command>sudoedit</command></term>
386 <listitem>
[bcd2922]387 <para>
[a1e0f76]388 is a symlink to <command>sudo</command> that implies the
[bcd2922]389 <option>-e</option> option to invoke an editor as another user.
390 </para>
[cf341b4]391 <indexterm zone="sudo sudoedit">
392 <primary sortas="b-sudoedit">sudoedit</primary>
393 </indexterm>
394 </listitem>
395 </varlistentry>
396
[72d90b67]397 <varlistentry id="sudoreplay">
398 <term><command>sudoreplay</command></term>
[3c0f868f]399 <listitem>
[bcd2922]400 <para>
[72d90b67]401 is used to play back or list the output
402 logs created by <command>sudo</command>.
[bcd2922]403 </para>
[72d90b67]404 <indexterm zone="sudo sudoreplay">
405 <primary sortas="b-sudoreplay">sudoreplay</primary>
[3c0f868f]406 </indexterm>
407 </listitem>
408 </varlistentry>
409
[72d90b67]410 <varlistentry id="visudo">
411 <term><command>visudo</command></term>
[61b8305]412 <listitem>
[bcd2922]413 <para>
[72d90b67]414 allows for safer editing of the <filename>sudoers</filename>
415 file.
[bcd2922]416 </para>
[72d90b67]417 <indexterm zone="sudo visudo">
418 <primary sortas="b-visudo">visudo</primary>
[61b8305]419 </indexterm>
420 </listitem>
421 </varlistentry>
[3c0f868f]422
[cf341b4]423 </variablelist>
424
425 </sect2>
426
427</sect1>
Note: See TracBrowser for help on using the repository browser.