source: postlfs/security/sudo.xml@ d7bbb40

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 9.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 d7bbb40 was d7bbb40, checked in by Douglas R. Reno <renodr@…>, 5 years ago

Update to sudo-1.8.28

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

  • Property mode set to 100644
File size: 11.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">
[d7bbb40]9 <!ENTITY sudo-md5sum "5afa5acd0c55b40916e4ad864607edfe">
10 <!ENTITY sudo-size "3.2 MB">
11 <!ENTITY sudo-buildsize "46 MB (with tests)">
12 <!ENTITY sudo-time "0.3 SBU (with 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
[3077c39]40 &lfs90_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
76 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
77
78 <bridgehead renderas="sect4">Optional</bridgehead>
[bcd2922]79 <para role="optional">
80 <xref linkend="linux-pam"/>,
81 <xref linkend="mitkrb"/>,
82 <xref linkend="openldap"/>,
[6b4f8529]83 <xref linkend="server-mail"/> (that provides a
84 <command>sendmail</command> command),
85 <ulink url="http://www.openafs.org/">AFS</ulink>,
[06915b3]86 <ulink url="http://www.fwtk.org/">FWTK</ulink>, and
[8dfc5c3]87 <ulink url="&sourceforge-dl;/opie/">Opie</ulink>
[06915b3]88<!-- <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>-->
[bcd2922]89 </para>
[b35e86b2]90
[3597eb6]91 <para condition="html" role="usernotes">User Notes:
[bcd2922]92 <ulink url="&blfs-wiki;/sudo"/>
93 </para>
[cf341b4]94 </sect2>
95
96 <sect2 role="installation">
97 <title>Installation of Sudo</title>
98
[bcd2922]99 <para>
[6e5d584]100 Install <application>Sudo</application> by running the following commands:
[bcd2922]101 </para>
[cf341b4]102
[1c69133]103<!-- Developer: apparently it is disabled by default, although in configure it
104is written otherwise -disable-static \-->
[b9d56ad4]105<screen><userinput>./configure --prefix=/usr \
[edaee95]106 --libexecdir=/usr/lib \
[1a657ca]107 --with-secure-path \
[b9d56ad4]108 --with-all-insults \
109 --with-env-editor \
110 --docdir=/usr/share/doc/sudo-&sudo-version; \
[9dabcf3]111 --with-passprompt="[sudo] password for %p: " &amp;&amp;
[cf341b4]112make</userinput></screen>
113
[bcd2922]114 <para>
[6b4f8529]115 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
116 | tee ../make-check.log</command>. Check the results with <command>grep
[ecd8cc2]117 failed ../make-check.log</command>. One test, test3, is known to fail
118 if the tests are run as the root user.
[bcd2922]119 </para>
[21755bc]120
[bcd2922]121 <para>
122 Now, as the <systemitem class="username">root</systemitem> user:
123 </para>
[cf341b4]124
[2809c8c]125<screen role="root"><userinput>make install &amp;&amp;
126ln -sfv libsudo_util.so.0.0.0 /usr/lib/sudo/libsudo_util.so.0</userinput></screen>
[cf341b4]127
128 </sect2>
129
130 <sect2 role="commands">
131 <title>Command Explanations</title>
132
[663b79c2]133 <para>
[edaee95]134 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
[663b79c2]135 private programs are installed. Everything in that directory is a library, so
136 they belong under <filename class="directory">/usr/lib</filename> instead of
137 <filename class="directory">/usr/libexec</filename>.
[8466229]138 </para>
139
140 <para>
141 <parameter>--with-secure-path</parameter>: This switch transparently adds
142 <filename class="directory">/sbin</filename> and <filename
143 class="directory">/usr/sbin</filename> directories to the
144 <envar>PATH</envar> environment variable.
[663b79c2]145 </para>
146
[bcd2922]147 <para>
[f3d174f]148 <parameter>--with-all-insults</parameter>: This switch includes all the
[bcd2922]149 <application>sudo</application> insult sets.
150 </para>
[cf341b4]151
[bcd2922]152 <para>
[f3d174f]153 <parameter>--with-env-editor</parameter>: This switch enables use of the
[bcd2922]154 environment variable EDITOR for <command>visudo</command>.
155 </para>
[8890b85f]156
[f3d174f]157 <para>
[ecea644]158 <parameter>--with-passprompt</parameter>: This switch sets the password prompt.
[f3d174f]159 </para>
160
[14c71e0]161 <para>
[f586237]162 <option>--without-pam</option>: This switch avoids building
163 <application>Linux-PAM</application> support when
164 <application>Linux-PAM</application> is installed on the system.
[14c71e0]165 </para>
[17b685f1]166<!-- See the developer note above before the configure command
[b9d56ad4]167 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
[f1d7196]168 href="../../xincludes/static-libraries.xml"/>-->
[b9d56ad4]169
[33d90fe]170 <note>
[bcd2922]171 <para>
172 There are many options to <application>sudo</application>'s
173 <command>configure</command> command. Check the
174 <command>configure --help</command> output for a complete list.
175 </para>
[33d90fe]176 </note>
[cf341b4]177
[2809c8c]178 <para>
[f586237]179 <command>ln -sfv libsudo_util...</command>: Works around a bug in the
[2809c8c]180 installation process, which links to the previously installed
181 version (if there is one) instead of the new one.
182 </para>
183
[cf341b4]184 </sect2>
185
186 <sect2 role="configuration">
187 <title>Configuring Sudo</title>
188
189 <sect3 id="sudo-config">
190 <title>Config File</title>
191
[7a47afc]192 <para>
193 <filename>/etc/sudoers</filename>
194 </para>
[cf341b4]195
196 <indexterm zone="sudo sudo-config">
197 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
198 </indexterm>
199
200 </sect3>
201
202 <sect3>
203 <title>Configuration Information</title>
204
[bcd2922]205 <para>
206 The <filename>sudoers</filename> file can be quite complicated. It
207 is composed of two types of entries: aliases (basically variables) and
208 user specifications (which specify who may run what). The installation
[b4c31a6]209 installs a default configuration that has no privileges installed for
210 any user.
[bcd2922]211 </para>
[bccbdaea]212
[a5b9f1e]213 <para>
[77b64bd]214 A couple of common configuration chanes are to set the path for the
215 super user and to allow members of the wheel group to execute all
216 commands after providing their own credientials. Use the following
217 commands to create the <filename>/etc/sudoers.d/sudo</filename>
218 configuration file as the
219 <systemitem class="username">root</systemitem> user:
[a5b9f1e]220 </para>
221
[77b64bd]222<screen role="root"><userinput>cat &gt; /etc/sudoers.d/sudo &lt;&lt; "EOF"
223<literal>Defaults secure_path="/usr/bin:/bin:/usr/sbin:/sbin"
224%wheel ALL=(ALL) ALL</literal>
225EOF</userinput></screen>
[a5b9f1e]226
[bcd2922]227 <para>
228 For details, see <command>man sudoers</command>.
229 </para>
[cf341b4]230
[3c0f868f]231 <note>
[bcd2922]232 <para>
233 The <application>Sudo</application> developers highly recommend
234 using the <command>visudo</command> program to edit the
235 <filename>sudoers</filename> file. This will provide basic sanity
[b4c31a6]236 checking like syntax parsing and file permission to avoid some
237 possible mistakes that could lead to a vulnerable configuration.
[bcd2922]238 </para>
[3c0f868f]239 </note>
240
[bcd2922]241 <para>
[14c71e0]242 If <application>PAM</application> is installed on the system,
243 <application>Sudo</application> is built with
[b4c31a6]244 <application>PAM</application> support. In that case, issue the
245 following command as the <systemitem class="username">root</systemitem>
246 user to create the <application>PAM</application> configuration file:
[bcd2922]247 </para>
[8890b85f]248
[add8d4f]249<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
250<literal># Begin /etc/pam.d/sudo
[b3a4f60]251
252# include the default auth settings
253auth include system-auth
254
255# include the default account settings
256account include system-account
257
258# Set default environment variables for the service user
259session required pam_env.so
260
261# include system session defaults
262session include system-session
263
[add8d4f]264# End /etc/pam.d/sudo</literal>
[b3a4f60]265EOF
266chmod 644 /etc/pam.d/sudo</userinput></screen>
[fd7e0ed6]267
[cf341b4]268 </sect3>
269
270 </sect2>
271
272 <sect2 role="content">
273 <title>Contents</title>
274
275 <segmentedlist>
276 <segtitle>Installed Programs</segtitle>
[9d53187]277 <segtitle>Installed Libraries</segtitle>
[cf341b4]278 <segtitle>Installed Directories</segtitle>
279
280 <seglistitem>
[bcd2922]281 <seg>
[d7bbb40]282 cvtsudoers, sudo, sudoedit (symlink), sudoreplay, and visudo
[bcd2922]283 </seg>
284 <seg>
[6b4f8529]285 group_file.so, libsudo_util.so,
286 sudoers.so, sudo_noexec.so, and system_group.so
[bcd2922]287 </seg>
288 <seg>
[7a47afc]289 /etc/sudoers.d,
[b378aa0]290 /usr/lib/sudo,
[06915b3]291 /usr/share/doc/sudo-&sudo-version;, and
292 /var/{lib,run}/sudo
[bcd2922]293 </seg>
[cf341b4]294 </seglistitem>
295 </segmentedlist>
296
297 <variablelist>
298 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
299 <?dbfo list-presentation="list"?>
300 <?dbhtml list-presentation="table"?>
301
[d7bbb40]302 <varlistentry id="cvtsudoers">
303 <term><command>cvtsudoers</command></term>
304 <listitem>
305 <para>
306 converts between sudoers file formats.
307 </para>
308 <indexterm zone="sudo cvtsudoers">
309 <primary sortas="b-cvtsudoers">cvtsudoers</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
[cf341b4]314 <varlistentry id="sudo_prog">
315 <term><command>sudo</command></term>
316 <listitem>
[bcd2922]317 <para>
318 executes a command as another user as permitted by
319 the <filename>/etc/sudoers</filename> configuration file.
[cf341b4]320 </para>
321 <indexterm zone="sudo sudo">
322 <primary sortas="b-sudo">sudo</primary>
323 </indexterm>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry id="sudoedit">
328 <term><command>sudoedit</command></term>
329 <listitem>
[bcd2922]330 <para>
[a1e0f76]331 is a symlink to <command>sudo</command> that implies the
[bcd2922]332 <option>-e</option> option to invoke an editor as another user.
333 </para>
[cf341b4]334 <indexterm zone="sudo sudoedit">
335 <primary sortas="b-sudoedit">sudoedit</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
[72d90b67]340 <varlistentry id="sudoreplay">
341 <term><command>sudoreplay</command></term>
[3c0f868f]342 <listitem>
[bcd2922]343 <para>
[72d90b67]344 is used to play back or list the output
345 logs created by <command>sudo</command>.
[bcd2922]346 </para>
[72d90b67]347 <indexterm zone="sudo sudoreplay">
348 <primary sortas="b-sudoreplay">sudoreplay</primary>
[3c0f868f]349 </indexterm>
350 </listitem>
351 </varlistentry>
352
[72d90b67]353 <varlistentry id="visudo">
354 <term><command>visudo</command></term>
[61b8305]355 <listitem>
[bcd2922]356 <para>
[72d90b67]357 allows for safer editing of the <filename>sudoers</filename>
358 file.
[bcd2922]359 </para>
[72d90b67]360 <indexterm zone="sudo visudo">
361 <primary sortas="b-visudo">visudo</primary>
[61b8305]362 </indexterm>
363 </listitem>
364 </varlistentry>
[3c0f868f]365
[cf341b4]366 </variablelist>
367
368 </sect2>
369
370</sect1>
Note: See TracBrowser for help on using the repository browser.