source: postlfs/security/sudo.xml@ 193bdf3

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 193bdf3 was 193bdf3, checked in by Bruce Dubbs <bdubbs@…>, 2 years ago

Expand sudo configuration comments

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