source: postlfs/security/sudo.xml@ b9d56ad4

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome kde5-13430 kde5-14269 kde5-14686 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 systemd-11177 systemd-13485 trunk upgradedb xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since b9d56ad4 was b9d56ad4, checked in by Fernando de Oliveira <fernando@…>, 10 years ago

Updates to sudo-1.8.10p1, openssh-6.6p1, ssh-askpass-6.6p1 and libatomic_ops-7.4.0. Fix Ruby-2.1.1 to build with Readline-6.3. Thanks Armin K.

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

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