source: postlfs/security/sudo.xml@ 926d146d

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 926d146d was 926d146d, checked in by Igor Živković <igor@…>, 10 years ago

official ftp download url for sudo

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