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

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 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 8dc47f9 was 8dc47f9, checked in by Fernando de Oliveira <fernando@…>, 9 years ago

Update to sudo-1.8.12.

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

  • Property mode set to 100644
File size: 10.5 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 "87558f3a55c62bc9244b19594f103ffa">
10 <!ENTITY sudo-size "2.4 MB">
11 <!ENTITY sudo-buildsize "24 MB">
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">Sudo Dependencies</bridgehead>
77
78 <bridgehead renderas="sect4">Optional</bridgehead>
79 <para role="optional">
80 <xref linkend="linux-pam"/>,
81 <xref linkend="mitkrb"/>,
82 <xref linkend="openldap"/>,
83 <xref linkend="server-mail"/> (that provides a
84 <command>sendmail</command> command),
85 <ulink url="http://www.openafs.org/">AFS</ulink>,
86 <ulink url="http://www.fwtk.org/">FWTK</ulink>,
87 <ulink url="http://sourceforge.net/projects/opie/files/">Opie</ulink>, and
88 <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>
89 </para>
90
91 <para condition="html" role="usernotes">User Notes:
92 <ulink url="&blfs-wiki;/sudo"/>
93 </para>
94 </sect2>
95
96 <sect2 role="installation">
97 <title>Installation of Sudo</title>
98
99 <para>
100 Install <application>Sudo</application> by running the following commands:
101 </para>
102
103<!-- Developer: apparently it is disabled by default, although in configure it
104is written otherwise -disable-static \-->
105<screen><userinput>./configure --prefix=/usr \
106 --libexecdir=/usr/lib \
107 --with-all-insults \
108 --with-env-editor \
109 --docdir=/usr/share/doc/sudo-&sudo-version; \
110 --with-passprompt="[sudo] password for %p" &amp;&amp;
111make</userinput></screen>
112
113 <para>
114 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
115 | tee ../make-check.log</command>. Check the results with <command>grep
116 failed ../make-check.log</command>.
117 </para>
118
119 <para>
120 Now, as the <systemitem class="username">root</systemitem> user:
121 </para>
122
123<screen role="root"><userinput>make install</userinput></screen>
124
125 </sect2>
126
127 <sect2 role="commands">
128 <title>Command Explanations</title>
129
130 <para>
131 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
132 private programs are installed. Everything in that directory is a library, so
133 they belong under <filename class="directory">/usr/lib</filename> instead of
134 <filename class="directory">/usr/libexec</filename>.
135 </para>
136
137 <para>
138 <parameter>--with-secure-path</parameter>: This switch transparently adds
139 <filename class="directory">/sbin</filename> and <filename
140 class="directory">/usr/sbin</filename> directories to the
141 <envar>PATH</envar> environment variable.
142 </para>
143
144 <para>
145 <parameter>--with-all-insults</parameter>: This switch includes all the
146 <application>sudo</application> insult sets.
147 </para>
148
149 <para>
150 <parameter>--with-env-editor</parameter>: This switch enables use of the
151 environment variable EDITOR for <command>visudo</command>.
152 </para>
153
154 <para>
155 <parameter>--with-passprompt</parameter>: This switch sets the prompt.
156 </para>
157
158 <para>
159 <option>--without-pam</option>: Avoids to build <application>PAM</application>
160 support when <application>PAM</application> is installed on the system.
161 </para>
162
163 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
164 href="../../xincludes/static-libraries.xml"/>
165
166 <note>
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>
172 </note>
173
174 </sect2>
175
176 <sect2 role="configuration">
177 <title>Configuring Sudo</title>
178
179 <sect3 id="sudo-config">
180 <title>Config File</title>
181
182 <para>
183 <filename>/etc/sudoers</filename>
184 </para>
185
186 <indexterm zone="sudo sudo-config">
187 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
188 </indexterm>
189
190 </sect3>
191
192 <sect3>
193 <title>Configuration Information</title>
194
195 <para>
196 The <filename>sudoers</filename> file can be quite complicated. It
197 is composed of two types of entries: aliases (basically variables) and
198 user specifications (which specify who may run what). The installation
199 installs a default configuration that has no privileges installed for any
200 user.
201 </para>
202
203 <para>
204 One example usage is to allow the system administrator to execute
205 any program without typing a password each time root privileges are
206 needed. This can be configured as:
207 </para>
208
209<screen># User alias specification
210User_Alias ADMIN = YourLoginId
211
212# Allow people in group ADMIN to run all commands without a password
213ADMIN ALL = NOPASSWD: ALL</screen>
214
215 <para>
216 For details, see <command>man sudoers</command>.
217 </para>
218
219 <note>
220 <para>
221 The <application>Sudo</application> developers highly recommend
222 using the <command>visudo</command> program to edit the
223 <filename>sudoers</filename> file. This will provide basic sanity
224 checking like syntax parsing and file permission to avoid some possible
225 mistakes that could lead to a vulnerable configuration.
226 </para>
227 </note>
228
229 <para>
230 If <application>PAM</application> is installed on the system,
231 <application>Sudo</application> is built with
232 <application>PAM</application> support. In that case, issue the following
233 command as the <systemitem class="username">root</systemitem> user
234 to create the <application>PAM</application> configuration file:
235 </para>
236
237<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
238<literal># Begin /etc/pam.d/sudo
239
240# include the default auth settings
241auth include system-auth
242
243# include the default account settings
244account include system-account
245
246# Set default environment variables for the service user
247session required pam_env.so
248
249# include system session defaults
250session include system-session
251
252# End /etc/pam.d/sudo</literal>
253EOF
254chmod 644 /etc/pam.d/sudo</userinput></screen>
255
256 </sect3>
257
258 </sect2>
259
260 <sect2 role="content">
261 <title>Contents</title>
262
263 <segmentedlist>
264 <segtitle>Installed Programs</segtitle>
265 <segtitle>Installed Libraries</segtitle>
266 <segtitle>Installed Directories</segtitle>
267
268 <seglistitem>
269 <seg>
270 sudo, sudoedit (symlink), sudoreplay, and visudo
271 </seg>
272 <seg>
273 group_file.so, libsudo_util.so,
274 sudoers.so, sudo_noexec.so, and system_group.so
275 </seg>
276 <seg>
277 /etc/sudoers.d,
278 /usr/lib/sudo,
279 /usr/share/doc/sudo-&sudo-version;,
280 /var/lib/sudo, and
281 /var/run/sudo
282 </seg>
283 </seglistitem>
284 </segmentedlist>
285
286 <variablelist>
287 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
288 <?dbfo list-presentation="list"?>
289 <?dbhtml list-presentation="table"?>
290
291 <varlistentry id="sudo_prog">
292 <term><command>sudo</command></term>
293 <listitem>
294 <para>
295 executes a command as another user as permitted by
296 the <filename>/etc/sudoers</filename> configuration file.
297 </para>
298 <indexterm zone="sudo sudo">
299 <primary sortas="b-sudo">sudo</primary>
300 </indexterm>
301 </listitem>
302 </varlistentry>
303
304 <varlistentry id="sudoedit">
305 <term><command>sudoedit</command></term>
306 <listitem>
307 <para>
308 is a symlink to <command>sudo</command> that implies the
309 <option>-e</option> option to invoke an editor as another user.
310 </para>
311 <indexterm zone="sudo sudoedit">
312 <primary sortas="b-sudoedit">sudoedit</primary>
313 </indexterm>
314 </listitem>
315 </varlistentry>
316
317 <varlistentry id="visudo">
318 <term><command>visudo</command></term>
319 <listitem>
320 <para>
321 allows for safer editing of the <filename>sudoers</filename>
322 file.
323 </para>
324 <indexterm zone="sudo visudo">
325 <primary sortas="b-visudo">visudo</primary>
326 </indexterm>
327 </listitem>
328 </varlistentry>
329
330 <varlistentry id="sudoreplay">
331 <term><command>sudoreplay</command></term>
332 <listitem>
333 <para>
334 is used to play back or list the output
335 logs created by <command>sudo</command>.
336 </para>
337 <indexterm zone="sudo sudoreplay">
338 <primary sortas="b-sudoreplay">sudoreplay</primary>
339 </indexterm>
340 </listitem>
341 </varlistentry>
342
343 </variablelist>
344
345 </sect2>
346
347</sect1>
Note: See TracBrowser for help on using the repository browser.