source: postlfs/security/sudo.xml@ 2206de82

12.1 gimp3 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/for-12.3 xry111/llvm18 xry111/spidermonkey128
Last change on this file since 2206de82 was 5183155, checked in by Pierre Labastie <pierre.labastie@…>, 10 months ago

Update to sudo-1.9.15p2

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