source: postlfs/security/sudo.xml@ d5ab5257

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules 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 d5ab5257 was f2d16168, checked in by Pierre Labastie <pieere@…>, 10 years ago

Add a patch to fix building sudo when PAM is not installed

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

  • Property mode set to 100644
File size: 10.8 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY sudo-download-http "http://www.sudo.ws/sudo/dist/sudo-&sudo-version;.tar.gz">
8 <!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
9 <!ENTITY sudo-md5sum "9a642cf6aca5375f8569a2961f44d0f3">
10 <!ENTITY sudo-size "2.3 MB">
11 <!ENTITY sudo-buildsize "24 MB (additional 2 MB for tests)">
12 <!ENTITY sudo-time "0.5 SBU">
13]>
14
15<sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
16 <?dbhtml filename="sudo.html"?>
17
18 <sect1info>
19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
21 </sect1info>
22
23 <title>Sudo-&sudo-version;</title>
24
25 <indexterm zone="sudo">
26 <primary sortas="a-Sudo">Sudo</primary>
27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Sudo</title>
31
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>
39
40 &lfs76_checked;
41
42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
45 <para>
46 Download (HTTP): <ulink url="&sudo-download-http;"/>
47 </para>
48 </listitem>
49 <listitem>
50 <para>
51 Download (FTP): <ulink url="&sudo-download-ftp;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download MD5 sum: &sudo-md5sum;
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download size: &sudo-size;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Estimated disk space required: &sudo-buildsize;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated build time: &sudo-time;
72 </para>
73 </listitem>
74 </itemizedlist>
75
76 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
77 <itemizedlist spacing="compact">
78 <listitem>
79 <para>
80 Patch required unless <xref linkend="linux-pam"/> is installed:
81 <ulink url="&patch-root;/sudo-&sudo-version;-lshadow_fix-1.patch"/>
82 </para>
83 </listitem>
84 </itemizedlist>
85
86 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
87
88 <bridgehead renderas="sect4">Optional</bridgehead>
89 <para role="optional">
90 <xref linkend="linux-pam"/>,
91 <xref linkend="mitkrb"/>,
92 <xref linkend="openldap"/>,
93 <xref linkend="server-mail"/> (that provides a
94 <command>sendmail</command> command),
95 <ulink url="http://www.openafs.org/">AFS</ulink>,
96 <ulink url="http://www.fwtk.org/">FWTK</ulink>,
97 <ulink url="http://sourceforge.net/projects/opie/files/">Opie</ulink>, and
98 <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>
99 </para>
100
101 <para condition="html" role="usernotes">User Notes:
102 <ulink url="&blfs-wiki;/sudo"/>
103 </para>
104 </sect2>
105
106 <sect2 role="installation">
107 <title>Installation of Sudo</title>
108
109 <para>
110 If <xref linkend="linux-pam"/> is not installed, apply the following
111 patch:
112 </para>
113
114<screen><userinput>patch -Np1 -i ../sudo-&sudo-version;-lshadow_fix-1.patch</userinput></screen>
115
116 <para>
117 Install <application>Sudo</application> by running the following commands:
118 </para>
119
120<!-- Developer: apparently it is disabled by default, although in configure it
121is written otherwise -disable-static \-->
122<screen><userinput>./configure --prefix=/usr \
123 --libexecdir=/usr/lib \
124 --with-all-insults \
125 --with-env-editor \
126 --docdir=/usr/share/doc/sudo-&sudo-version; \
127 --with-passprompt="[sudo] password for %p" &amp;&amp;
128make</userinput></screen>
129
130 <para>
131 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
132 | tee ../make-check.log</command>. Check the results with <command>grep
133 failed ../make-check.log</command>.
134 </para>
135
136 <para>
137 Now, as the <systemitem class="username">root</systemitem> user:
138 </para>
139
140<screen role="root"><userinput>make install</userinput></screen>
141
142 </sect2>
143
144 <sect2 role="commands">
145 <title>Command Explanations</title>
146
147 <para>
148 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
149 private programs are installed. Everything in that directory is a library, so
150 they belong under <filename class="directory">/usr/lib</filename> instead of
151 <filename class="directory">/usr/libexec</filename>.
152 </para>
153
154 <para>
155 <parameter>--with-all-insults</parameter>: This switch includes all the
156 <application>sudo</application> insult sets.
157 </para>
158
159 <para>
160 <parameter>--with-env-editor</parameter>: This switch enables use of the
161 environment variable EDITOR for <command>visudo</command>.
162 </para>
163
164 <para>
165 <parameter>--with-passprompt</parameter>: This switch sets the prompt.
166 </para>
167
168 <para>
169 <option>--without-pam</option>: Avoids to build <application>PAM</application>
170 support when <application>PAM</application> is installed on the system.
171 </para>
172
173 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
174 href="../../xincludes/static-libraries.xml"/>
175
176 <note>
177 <para>
178 There are many options to <application>sudo</application>'s
179 <command>configure</command> command. Check the
180 <command>configure --help</command> output for a complete list.
181 </para>
182 </note>
183
184 </sect2>
185
186 <sect2 role="configuration">
187 <title>Configuring Sudo</title>
188
189 <sect3 id="sudo-config">
190 <title>Config File</title>
191
192 <para>
193 <filename>/etc/sudoers</filename>
194 </para>
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
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
209 installs a default configuration that has no privileges installed for any
210 user.
211 </para>
212
213 <para>
214 One example usage is to allow the system administrator to execute
215 any program without typing a password each time root privileges are
216 needed. This can be configured as:
217 </para>
218
219<screen># User alias specification
220User_Alias ADMIN = YourLoginId
221
222# Allow people in group ADMIN to run all commands without a password
223ADMIN ALL = NOPASSWD: ALL</screen>
224
225 <para>
226 For details, see <command>man sudoers</command>.
227 </para>
228
229 <note>
230 <para>
231 The <application>Sudo</application> developers highly recommend
232 using the <command>visudo</command> program to edit the
233 <filename>sudoers</filename> file. This will provide basic sanity
234 checking like syntax parsing and file permission to avoid some possible
235 mistakes that could lead to a vulnerable configuration.
236 </para>
237 </note>
238
239 <para>
240 If <application>PAM</application> is installed on the system,
241 <application>Sudo</application> is built with
242 <application>PAM</application> support. In that case, issue the following
243 command as the <systemitem class="username">root</systemitem> user
244 to create the <application>PAM</application> configuration file:
245 </para>
246
247<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
248<literal># Begin /etc/pam.d/sudo
249
250# include the default auth settings
251auth include system-auth
252
253# include the default account settings
254account include system-account
255
256# Set default environment variables for the service user
257session required pam_env.so
258
259# include system session defaults
260session include system-session
261
262# End /etc/pam.d/sudo</literal>
263EOF
264chmod 644 /etc/pam.d/sudo</userinput></screen>
265
266 </sect3>
267
268 </sect2>
269
270 <sect2 role="content">
271 <title>Contents</title>
272
273 <segmentedlist>
274 <segtitle>Installed Programs</segtitle>
275 <segtitle>Installed Libraries</segtitle>
276 <segtitle>Installed Directories</segtitle>
277
278 <seglistitem>
279 <seg>
280 sudo, sudoedit (symlink), sudoreplay, and visudo
281 </seg>
282 <seg>
283 group_file.so, libsudo_util.so,
284 sudoers.so, sudo_noexec.so, and system_group.so
285 </seg>
286 <seg>
287 /etc/sudoers.d,
288 /run/sudo,
289 /usr/lib/sudo,
290 /usr/share/doc/sudo-&sudo-version;, and
291 /var/lib/sudo
292 </seg>
293 </seglistitem>
294 </segmentedlist>
295
296 <variablelist>
297 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
298 <?dbfo list-presentation="list"?>
299 <?dbhtml list-presentation="table"?>
300
301 <varlistentry id="sudo_prog">
302 <term><command>sudo</command></term>
303 <listitem>
304 <para>
305 executes a command as another user as permitted by
306 the <filename>/etc/sudoers</filename> configuration file.
307 </para>
308 <indexterm zone="sudo sudo">
309 <primary sortas="b-sudo">sudo</primary>
310 </indexterm>
311 </listitem>
312 </varlistentry>
313
314 <varlistentry id="sudoedit">
315 <term><command>sudoedit</command></term>
316 <listitem>
317 <para>
318 is a symlink to <command>sudo</command> that implies the
319 <option>-e</option> option to invoke an editor as another user.
320 </para>
321 <indexterm zone="sudo sudoedit">
322 <primary sortas="b-sudoedit">sudoedit</primary>
323 </indexterm>
324 </listitem>
325 </varlistentry>
326
327 <varlistentry id="visudo">
328 <term><command>visudo</command></term>
329 <listitem>
330 <para>
331 allows for safer editing of the <filename>sudoers</filename>
332 file.
333 </para>
334 <indexterm zone="sudo visudo">
335 <primary sortas="b-visudo">visudo</primary>
336 </indexterm>
337 </listitem>
338 </varlistentry>
339
340 <varlistentry id="sudoreplay">
341 <term><command>sudoreplay</command></term>
342 <listitem>
343 <para>
344 is used to play back or list the output
345 logs created by <command>sudo</command>.
346 </para>
347 <indexterm zone="sudo sudoreplay">
348 <primary sortas="b-sudoreplay">sudoreplay</primary>
349 </indexterm>
350 </listitem>
351 </varlistentry>
352
353 </variablelist>
354
355 </sect2>
356
357</sect1>
Note: See TracBrowser for help on using the repository browser.