source: postlfs/security/sudo.xml@ 8f410c7

12.1 12.2 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 8f410c7 was 7b8bec72, checked in by Xi Ruoyao <xry111@…>, 12 months ago

Fix URLs of external depedencies, remove dead "User Notes"

  • Property mode set to 100644
File size: 13.2 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">
[926d146d]8 <!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
[41a259b]9 <!ENTITY sudo-md5sum "4cc21cf7c9a89290b230954aed0d1e11">
[0b8ce67c]10 <!ENTITY sudo-size "5.0 MB">
[500d0cc4]11 <!ENTITY sudo-buildsize "51 MB (add 17 MB for tests)">
[0a22f18]12 <!ENTITY sudo-time "0.2 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),
[7b8bec72]81 <ulink url="https://www.openafs.org/">AFS</ulink>, and
82<!-- It seems dead for decades, nowhere to download source code
[cd29bc9]83 <ulink url="https://www.fwtk.org/">FWTK</ulink>, and
[7b8bec72]84-->
[8dfc5c3]85 <ulink url="&sourceforge-dl;/opie/">Opie</ulink>
[bcd2922]86 </para>
[b35e86b2]87
[42ddc30]88 <para condition="html" role="usernotes">Editor Notes:
[bcd2922]89 <ulink url="&blfs-wiki;/sudo"/>
90 </para>
[cf341b4]91 </sect2>
92
93 <sect2 role="installation">
94 <title>Installation of Sudo</title>
95
[bcd2922]96 <para>
[6e5d584]97 Install <application>Sudo</application> by running the following commands:
[bcd2922]98 </para>
[cf341b4]99
[b9d56ad4]100<screen><userinput>./configure --prefix=/usr \
[edaee95]101 --libexecdir=/usr/lib \
[1a657ca]102 --with-secure-path \
[b9d56ad4]103 --with-all-insults \
104 --with-env-editor \
105 --docdir=/usr/share/doc/sudo-&sudo-version; \
[9dabcf3]106 --with-passprompt="[sudo] password for %p: " &amp;&amp;
[cf341b4]107make</userinput></screen>
108
[bcd2922]109 <para>
[6b4f8529]110 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
[36a32ef]111 | tee make-check.log</command>. Check the results with <command>grep
[8558044]112 failed make-check.log</command>.
[bcd2922]113 </para>
[21755bc]114
[bcd2922]115 <para>
116 Now, as the <systemitem class="username">root</systemitem> user:
117 </para>
[cf341b4]118
[0a22f18]119<!-- for a DESTDIR install as normal user, use
120 "make install INSTALL_OWNER= DESTDIR=<destdir>"-->
[2809c8c]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>
[cf341b4]123
124 </sect2>
125
126 <sect2 role="commands">
127 <title>Command Explanations</title>
128
[663b79c2]129 <para>
[edaee95]130 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
[663b79c2]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>.
[8466229]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.
[663b79c2]141 </para>
142
[bcd2922]143 <para>
[f3d174f]144 <parameter>--with-all-insults</parameter>: This switch includes all the
[bcd2922]145 <application>sudo</application> insult sets.
146 </para>
[cf341b4]147
[bcd2922]148 <para>
[f3d174f]149 <parameter>--with-env-editor</parameter>: This switch enables use of the
[bcd2922]150 environment variable EDITOR for <command>visudo</command>.
151 </para>
[8890b85f]152
[f3d174f]153 <para>
[ecea644]154 <parameter>--with-passprompt</parameter>: This switch sets the password prompt.
[7f99ddf]155 The <parameter>%p</parameter> will be expanded to the name of the user whose password is being requested.
[f3d174f]156 </para>
157
[14c71e0a]158 <para>
[f586237]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.
[14c71e0a]162 </para>
[17b685f1]163<!-- See the developer note above before the configure command
[b9d56ad4]164 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[f1d7196]165 href="../../xincludes/static-libraries.xml"/>-->
[b9d56ad4]166
[33d90fe]167 <note>
[bcd2922]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>
[33d90fe]173 </note>
[cf341b4]174
[2809c8c]175 <para>
[f586237]176 <command>ln -sfv libsudo_util...</command>: Works around a bug in the
[2809c8c]177 installation process, which links to the previously installed
178 version (if there is one) instead of the new one.
179 </para>
180
[cf341b4]181 </sect2>
182
183 <sect2 role="configuration">
184 <title>Configuring Sudo</title>
185
186 <sect3 id="sudo-config">
187 <title>Config File</title>
188
[7a47afc]189 <para>
190 <filename>/etc/sudoers</filename>
191 </para>
[cf341b4]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
[bcd2922]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
[b4c31a6]206 installs a default configuration that has no privileges installed for
207 any user.
[bcd2922]208 </para>
[bccbdaea]209
[a5b9f1e]210 <para>
[c513d6e6]211 A couple of common configuration changes are to set the path for the
[77b64bd]212 super user and to allow members of the wheel group to execute all
[5031e90]213 commands after providing their own credentials. Use the following
[7826062]214 commands to create the <filename>/etc/sudoers.d/00-sudo</filename>
[77b64bd]215 configuration file as the
216 <systemitem class="username">root</systemitem> user:
[a5b9f1e]217 </para>
218
[193bdf3]219<screen role="root"><userinput>cat &gt; /etc/sudoers.d/00-sudo &lt;&lt; "EOF"
[2f4e6181]220<literal>Defaults secure_path="/usr/sbin:/usr/bin"
[77b64bd]221%wheel ALL=(ALL) ALL</literal>
222EOF</userinput></screen>
[8558044]223
[193bdf3]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
[7a9a7b26]230 import the non-privileged user's full environment into the
[193bdf3]231 privileged session.
232 </para>
[7a9a7b26]233
[193bdf3]234 <para>
[7a9a7b26]235 The files in the <filename class="directory">/etc/sudoers.d</filename>
236 directory are parsed in sorted lexical order. Be careful that entries
[193bdf3]237 in an added file do not overwrite previous entries.
238 </para>
239 </note>
240
[bcd2922]241 <para>
242 For details, see <command>man sudoers</command>.
243 </para>
[cf341b4]244
[3c0f868f]245 <note>
[bcd2922]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
[b4c31a6]250 checking like syntax parsing and file permission to avoid some
251 possible mistakes that could lead to a vulnerable configuration.
[bcd2922]252 </para>
[3c0f868f]253 </note>
254
[bcd2922]255 <para>
[14c71e0a]256 If <application>PAM</application> is installed on the system,
257 <application>Sudo</application> is built with
[b4c31a6]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:
[bcd2922]261 </para>
[8890b85f]262
[add8d4f]263<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
264<literal># Begin /etc/pam.d/sudo
[b3a4f60]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
[add8d4f]278# End /etc/pam.d/sudo</literal>
[b3a4f60]279EOF
280chmod 644 /etc/pam.d/sudo</userinput></screen>
[fd7e0ed6]281
[cf341b4]282 </sect3>
283
284 </sect2>
285
286 <sect2 role="content">
287 <title>Contents</title>
288
289 <segmentedlist>
290 <segtitle>Installed Programs</segtitle>
[9d53187]291 <segtitle>Installed Libraries</segtitle>
[cf341b4]292 <segtitle>Installed Directories</segtitle>
293
294 <seglistitem>
[bcd2922]295 <seg>
[a82b5f44]296 cvtsudoers, sudo, sudo_logsrvd, sudo_sendlog,
297 sudoedit (symlink), sudoreplay, and visudo
[bcd2922]298 </seg>
299 <seg>
[a82b5f44]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,
[6b4f8529]305 sudoers.so, sudo_noexec.so, and system_group.so
[bcd2922]306 </seg>
307 <seg>
[7a47afc]308 /etc/sudoers.d,
[b378aa0]309 /usr/lib/sudo,
[06915b3]310 /usr/share/doc/sudo-&sudo-version;, and
[a82b5f44]311 /var/lib/sudo
[bcd2922]312 </seg>
[cf341b4]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
[d7bbb40]321 <varlistentry id="cvtsudoers">
322 <term><command>cvtsudoers</command></term>
323 <listitem>
324 <para>
[4c24eb0a]325 converts between sudoers file formats
[d7bbb40]326 </para>
327 <indexterm zone="sudo cvtsudoers">
328 <primary sortas="b-cvtsudoers">cvtsudoers</primary>
329 </indexterm>
330 </listitem>
331 </varlistentry>
332
[cf341b4]333 <varlistentry id="sudo_prog">
334 <term><command>sudo</command></term>
335 <listitem>
[bcd2922]336 <para>
337 executes a command as another user as permitted by
[4c24eb0a]338 the <filename>/etc/sudoers</filename> configuration file
[cf341b4]339 </para>
340 <indexterm zone="sudo sudo">
341 <primary sortas="b-sudo">sudo</primary>
342 </indexterm>
343 </listitem>
344 </varlistentry>
345
[a82b5f44]346 <varlistentry id="sudo_logsrvd">
347 <term><command>sudo_logsrvd</command></term>
348 <listitem>
349 <para>
[4c24eb0a]350 is a sudo event and I/O log server
[a82b5f44]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>
[4c24eb0a]362 sends sudo I/O logs to the log server
[a82b5f44]363 </para>
364 <indexterm zone="sudo sudo_sendlog">
365 <primary sortas="b-sudo_sendlog">sudo_sendlog</primary>
366 </indexterm>
367 </listitem>
368 </varlistentry>
369
[cf341b4]370 <varlistentry id="sudoedit">
371 <term><command>sudoedit</command></term>
372 <listitem>
[bcd2922]373 <para>
[a1e0f76]374 is a symlink to <command>sudo</command> that implies the
[4c24eb0a]375 <option>-e</option> option to invoke an editor as another user
[bcd2922]376 </para>
[cf341b4]377 <indexterm zone="sudo sudoedit">
378 <primary sortas="b-sudoedit">sudoedit</primary>
379 </indexterm>
380 </listitem>
381 </varlistentry>
382
[72d90b67]383 <varlistentry id="sudoreplay">
384 <term><command>sudoreplay</command></term>
[3c0f868f]385 <listitem>
[bcd2922]386 <para>
[72d90b67]387 is used to play back or list the output
[4c24eb0a]388 logs created by <command>sudo</command>
[bcd2922]389 </para>
[72d90b67]390 <indexterm zone="sudo sudoreplay">
391 <primary sortas="b-sudoreplay">sudoreplay</primary>
[3c0f868f]392 </indexterm>
393 </listitem>
394 </varlistentry>
395
[72d90b67]396 <varlistentry id="visudo">
397 <term><command>visudo</command></term>
[61b8305]398 <listitem>
[bcd2922]399 <para>
[72d90b67]400 allows for safer editing of the <filename>sudoers</filename>
[4c24eb0a]401 file
[bcd2922]402 </para>
[72d90b67]403 <indexterm zone="sudo visudo">
404 <primary sortas="b-visudo">visudo</primary>
[61b8305]405 </indexterm>
406 </listitem>
407 </varlistentry>
[3c0f868f]408
[cf341b4]409 </variablelist>
410
411 </sect2>
412
413</sect1>
Note: See TracBrowser for help on using the repository browser.