source: postlfs/security/sudo.xml@ cacae795

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.5 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 cacae795 was cacae795, checked in by Bruce Dubbs <bdubbs@…>, 10 years ago

First set of LFS-7.5 tags

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

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