source: postlfs/security/sudo.xml@ ddf6739b

10.0 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 ddf6739b was ddf6739b, checked in by Thomas Trepl <thomas@…>, 4 years ago

Upgrade to sudo-1.9.1

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

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