source: postlfs/security/sudo.xml@ b8242d8

kde5-14686 systemd-13485
Last change on this file since b8242d8 was b8242d8, checked in by Christopher Gregory <cjg@…>, 10 years ago

Fix book validation due to libreoffice merge. Merge updates from trunk.

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/branches/systemd@14551 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 10.3 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 "5065deec62e8cd514fb04d1d1253db03">
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 (additional 0.1 SBU for tests)">
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-all-insults</parameter>: This switch includes all the
139 <application>sudo</application> insult sets.
140 </para>
141
142 <para>
143 <parameter>--with-env-editor</parameter>: This switch enables use of the
144 environment variable EDITOR for <command>visudo</command>.
145 </para>
146
147 <para>
148 <parameter>--with-passprompt</parameter>: This switch sets the prompt.
149 </para>
150
151 <para>
152 <option>--without-pam</option>: Avoids to build <application>PAM</application>
153 support when <application>PAM</application> is installed on the system.
154 </para>
155
156 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
157 href="../../xincludes/static-libraries.xml"/>
158
159 <note>
160 <para>
161 There are many options to <application>sudo</application>'s
162 <command>configure</command> command. Check the
163 <command>configure --help</command> output for a complete list.
164 </para>
165 </note>
166
167 </sect2>
168
169 <sect2 role="configuration">
170 <title>Configuring Sudo</title>
171
172 <sect3 id="sudo-config">
173 <title>Config File</title>
174
175 <para>
176 <filename>/etc/sudoers</filename>
177 </para>
178
179 <indexterm zone="sudo sudo-config">
180 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
181 </indexterm>
182
183 </sect3>
184
185 <sect3>
186 <title>Configuration Information</title>
187
188 <para>
189 The <filename>sudoers</filename> file can be quite complicated. It
190 is composed of two types of entries: aliases (basically variables) and
191 user specifications (which specify who may run what). The installation
192 installs a default configuration that has no privileges installed for any
193 user.
194 </para>
195
196 <para>
197 One example usage is to allow the system administrator to execute
198 any program without typing a password each time root privileges are
199 needed. This can be configured as:
200 </para>
201
202<screen># User alias specification
203User_Alias ADMIN = YourLoginId
204
205# Allow people in group ADMIN to run all commands without a password
206ADMIN ALL = NOPASSWD: ALL</screen>
207
208 <para>
209 For details, see <command>man sudoers</command>.
210 </para>
211
212 <note>
213 <para>
214 The <application>Sudo</application> developers highly recommend
215 using the <command>visudo</command> program to edit the
216 <filename>sudoers</filename> file. This will provide basic sanity
217 checking like syntax parsing and file permission to avoid some possible
218 mistakes that could lead to a vulnerable configuration.
219 </para>
220 </note>
221
222 <para>
223 If <application>PAM</application> is installed on the system,
224 <application>Sudo</application> is built with
225 <application>PAM</application> support. In that case, issue the following
226 command as the <systemitem class="username">root</systemitem> user
227 to create the <application>PAM</application> configuration file:
228 </para>
229
230<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
231<literal># Begin /etc/pam.d/sudo
232
233# include the default auth settings
234auth include system-auth
235
236# include the default account settings
237account include system-account
238
239# Set default environment variables for the service user
240session required pam_env.so
241
242# include system session defaults
243session include system-session
244
245# End /etc/pam.d/sudo</literal>
246EOF
247chmod 644 /etc/pam.d/sudo</userinput></screen>
248
249 </sect3>
250
251 </sect2>
252
253 <sect2 role="content">
254 <title>Contents</title>
255
256 <segmentedlist>
257 <segtitle>Installed Programs</segtitle>
258 <segtitle>Installed Libraries</segtitle>
259 <segtitle>Installed Directories</segtitle>
260
261 <seglistitem>
262 <seg>
263 sudo, sudoedit (symlink), sudoreplay, and visudo
264 </seg>
265 <seg>
266 group_file.so, libsudo_util.so,
267 sudoers.so, sudo_noexec.so, and system_group.so
268 </seg>
269 <seg>
270 /etc/sudoers.d,
271 /run/sudo,
272 /usr/lib/sudo,
273 /usr/share/doc/sudo-&sudo-version;, and
274 /var/lib/sudo
275 </seg>
276 </seglistitem>
277 </segmentedlist>
278
279 <variablelist>
280 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
281 <?dbfo list-presentation="list"?>
282 <?dbhtml list-presentation="table"?>
283
284 <varlistentry id="sudo_prog">
285 <term><command>sudo</command></term>
286 <listitem>
287 <para>
288 executes a command as another user as permitted by
289 the <filename>/etc/sudoers</filename> configuration file.
290 </para>
291 <indexterm zone="sudo sudo">
292 <primary sortas="b-sudo">sudo</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 <varlistentry id="sudoedit">
298 <term><command>sudoedit</command></term>
299 <listitem>
300 <para>
301 is a symlink to <command>sudo</command> that implies the
302 <option>-e</option> option to invoke an editor as another user.
303 </para>
304 <indexterm zone="sudo sudoedit">
305 <primary sortas="b-sudoedit">sudoedit</primary>
306 </indexterm>
307 </listitem>
308 </varlistentry>
309
310 <varlistentry id="visudo">
311 <term><command>visudo</command></term>
312 <listitem>
313 <para>
314 allows for safer editing of the <filename>sudoers</filename>
315 file.
316 </para>
317 <indexterm zone="sudo visudo">
318 <primary sortas="b-visudo">visudo</primary>
319 </indexterm>
320 </listitem>
321 </varlistentry>
322
323 <varlistentry id="sudoreplay">
324 <term><command>sudoreplay</command></term>
325 <listitem>
326 <para>
327 is used to play back or list the output
328 logs created by <command>sudo</command>.
329 </para>
330 <indexterm zone="sudo sudoreplay">
331 <primary sortas="b-sudoreplay">sudoreplay</primary>
332 </indexterm>
333 </listitem>
334 </varlistentry>
335
336 </variablelist>
337
338 </sect2>
339
340</sect1>
Note: See TracBrowser for help on using the repository browser.