source: postlfs/security/sudo.xml@ 0979b07d

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 0979b07d was 8466229, checked in by Igor Živković <igor@…>, 9 years ago

compile sudo with option to automatically add super user directories to the path

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

  • Property mode set to 100644
File size: 10.6 KB
RevLine 
[cf341b4]1<?xml version="1.0" encoding="ISO-8859-1"?>
[6732c094]2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
[cf341b4]4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
[fc87618]7 <!ENTITY sudo-download-http "http://www.sudo.ws/sudo/dist/sudo-&sudo-version;.tar.gz">
[926d146d]8 <!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
[2b3dfe0]9 <!ENTITY sudo-md5sum "84012b4871b6c775c957cd310d5bad87">
[6b4f8529]10 <!ENTITY sudo-size "2.3 MB">
11 <!ENTITY sudo-buildsize "24 MB (additional 2 MB for tests)">
[2b3dfe0]12 <!ENTITY sudo-time "0.5 SBU (additional less than 0.1 SBU for tests)">
[cf341b4]13]>
14
[bcd2922]15<sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
[cf341b4]16 <?dbhtml filename="sudo.html"?>
17
18 <sect1info>
[e19ad480]19 <othername>$LastChangedBy$</othername>
20 <date>$Date$</date>
[cf341b4]21 </sect1info>
22
23 <title>Sudo-&sudo-version;</title>
24
25 <indexterm zone="sudo">
[bcd2922]26 <primary sortas="a-Sudo">Sudo</primary>
[cf341b4]27 </indexterm>
28
29 <sect2 role="package">
30 <title>Introduction to Sudo</title>
31
[bcd2922]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>
[cf341b4]39
[171a5dd]40 &lfs76_checked;
[a8d3d55a]41
[cf341b4]42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
[bcd2922]45 <para>
46 Download (HTTP): <ulink url="&sudo-download-http;"/>
47 </para>
[cf341b4]48 </listitem>
49 <listitem>
[bcd2922]50 <para>
51 Download (FTP): <ulink url="&sudo-download-ftp;"/>
52 </para>
[cf341b4]53 </listitem>
54 <listitem>
[bcd2922]55 <para>
56 Download MD5 sum: &sudo-md5sum;
57 </para>
[cf341b4]58 </listitem>
59 <listitem>
[bcd2922]60 <para>
61 Download size: &sudo-size;
62 </para>
[cf341b4]63 </listitem>
64 <listitem>
[bcd2922]65 <para>
66 Estimated disk space required: &sudo-buildsize;
67 </para>
[cf341b4]68 </listitem>
69 <listitem>
[bcd2922]70 <para>
71 Estimated build time: &sudo-time;
72 </para>
[cf341b4]73 </listitem>
74 </itemizedlist>
75
76 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
77
78 <bridgehead renderas="sect4">Optional</bridgehead>
[bcd2922]79 <para role="optional">
80 <xref linkend="linux-pam"/>,
81 <xref linkend="mitkrb"/>,
82 <xref linkend="openldap"/>,
[6b4f8529]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
[bcd2922]88 <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>
89 </para>
[b35e86b2]90
[3597eb6]91 <para condition="html" role="usernotes">User Notes:
[bcd2922]92 <ulink url="&blfs-wiki;/sudo"/>
93 </para>
[cf341b4]94 </sect2>
95
96 <sect2 role="installation">
97 <title>Installation of Sudo</title>
98
[bcd2922]99 <para>
[6e5d584]100 Install <application>Sudo</application> by running the following commands:
[bcd2922]101 </para>
[cf341b4]102
[1c69133]103<!-- Developer: apparently it is disabled by default, although in configure it
104is written otherwise -disable-static \-->
[b9d56ad4]105<screen><userinput>./configure --prefix=/usr \
[edaee95]106 --libexecdir=/usr/lib \
[8466229]107 --with-secure-path \
[b9d56ad4]108 --with-all-insults \
109 --with-env-editor \
110 --docdir=/usr/share/doc/sudo-&sudo-version; \
[439ebd01]111 --with-passprompt="[sudo] password for %p" &amp;&amp;
[cf341b4]112make</userinput></screen>
113
[bcd2922]114 <para>
[6b4f8529]115 To test the results, issue: <command>env LC_ALL=C make check 2&gt;&amp;1
116 | tee ../make-check.log</command>. Check the results with <command>grep
117 failed ../make-check.log</command>.
[bcd2922]118 </para>
[21755bc]119
[bcd2922]120 <para>
121 Now, as the <systemitem class="username">root</systemitem> user:
122 </para>
[cf341b4]123
124<screen role="root"><userinput>make install</userinput></screen>
125
126 </sect2>
127
128 <sect2 role="commands">
129 <title>Command Explanations</title>
130
[663b79c2]131 <para>
[edaee95]132 <parameter>--libexecdir=/usr/lib</parameter>: This switch controls where
[663b79c2]133 private programs are installed. Everything in that directory is a library, so
134 they belong under <filename class="directory">/usr/lib</filename> instead of
135 <filename class="directory">/usr/libexec</filename>.
[8466229]136 </para>
137
138 <para>
139 <parameter>--with-secure-path</parameter>: This switch transparently adds
140 <filename class="directory">/sbin</filename> and <filename
141 class="directory">/usr/sbin</filename> directories to the
142 <envar>PATH</envar> environment variable.
[663b79c2]143 </para>
144
[bcd2922]145 <para>
[f3d174f]146 <parameter>--with-all-insults</parameter>: This switch includes all the
[bcd2922]147 <application>sudo</application> insult sets.
148 </para>
[cf341b4]149
[bcd2922]150 <para>
[f3d174f]151 <parameter>--with-env-editor</parameter>: This switch enables use of the
[bcd2922]152 environment variable EDITOR for <command>visudo</command>.
153 </para>
[8890b85f]154
[f3d174f]155 <para>
156 <parameter>--with-passprompt</parameter>: This switch sets the prompt.
157 </para>
158
[14c71e0]159 <para>
160 <option>--without-pam</option>: Avoids to build <application>PAM</application>
161 support when <application>PAM</application> is installed on the system.
162 </para>
163
[b9d56ad4]164 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
165 href="../../xincludes/static-libraries.xml"/>
166
[33d90fe]167 <note>
[bcd2922]168 <para>
169 There are many options to <application>sudo</application>'s
170 <command>configure</command> command. Check the
171 <command>configure --help</command> output for a complete list.
172 </para>
[33d90fe]173 </note>
[cf341b4]174
175 </sect2>
176
177 <sect2 role="configuration">
178 <title>Configuring Sudo</title>
179
180 <sect3 id="sudo-config">
181 <title>Config File</title>
182
[7a47afc]183 <para>
184 <filename>/etc/sudoers</filename>
185 </para>
[cf341b4]186
187 <indexterm zone="sudo sudo-config">
188 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
189 </indexterm>
190
191 </sect3>
192
193 <sect3>
194 <title>Configuration Information</title>
195
[bcd2922]196 <para>
197 The <filename>sudoers</filename> file can be quite complicated. It
198 is composed of two types of entries: aliases (basically variables) and
199 user specifications (which specify who may run what). The installation
200 installs a default configuration that has no privileges installed for any
201 user.
202 </para>
[cf341b4]203
[bcd2922]204 <para>
205 One example usage is to allow the system administrator to execute
206 any program without typing a password each time root privileges are
207 needed. This can be configured as:
208 </para>
[bccbdaea]209
[ed025d6]210<screen># User alias specification
[cf341b4]211User_Alias ADMIN = YourLoginId
212
213# Allow people in group ADMIN to run all commands without a password
214ADMIN ALL = NOPASSWD: ALL</screen>
215
[bcd2922]216 <para>
217 For details, see <command>man sudoers</command>.
218 </para>
[cf341b4]219
[3c0f868f]220 <note>
[bcd2922]221 <para>
222 The <application>Sudo</application> developers highly recommend
223 using the <command>visudo</command> program to edit the
224 <filename>sudoers</filename> file. This will provide basic sanity
225 checking like syntax parsing and file permission to avoid some possible
226 mistakes that could lead to a vulnerable configuration.
227 </para>
[3c0f868f]228 </note>
229
[bcd2922]230 <para>
[14c71e0]231 If <application>PAM</application> is installed on the system,
232 <application>Sudo</application> is built with
233 <application>PAM</application> support. In that case, issue the following
[bcd2922]234 command as the <systemitem class="username">root</systemitem> user
235 to create the <application>PAM</application> configuration file:
236 </para>
[8890b85f]237
[add8d4f]238<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF"
239<literal># Begin /etc/pam.d/sudo
[b3a4f60]240
241# include the default auth settings
242auth include system-auth
243
244# include the default account settings
245account include system-account
246
247# Set default environment variables for the service user
248session required pam_env.so
249
250# include system session defaults
251session include system-session
252
[add8d4f]253# End /etc/pam.d/sudo</literal>
[b3a4f60]254EOF
255chmod 644 /etc/pam.d/sudo</userinput></screen>
[fd7e0ed6]256
[cf341b4]257 </sect3>
258
259 </sect2>
260
261 <sect2 role="content">
262 <title>Contents</title>
263
264 <segmentedlist>
265 <segtitle>Installed Programs</segtitle>
[7a47afc]266 <segtitle>Installed Libraries</segtitle>
[cf341b4]267 <segtitle>Installed Directories</segtitle>
268
269 <seglistitem>
[bcd2922]270 <seg>
[a1e0f76]271 sudo, sudoedit (symlink), sudoreplay, and visudo
[bcd2922]272 </seg>
273 <seg>
[6b4f8529]274 group_file.so, libsudo_util.so,
275 sudoers.so, sudo_noexec.so, and system_group.so
[bcd2922]276 </seg>
277 <seg>
[7a47afc]278 /etc/sudoers.d,
[b378aa0]279 /usr/lib/sudo,
[ed2179c9]280 /usr/share/doc/sudo-&sudo-version;,
281 /var/lib/sudo, and
282 /var/run/sudo
[bcd2922]283 </seg>
[cf341b4]284 </seglistitem>
285 </segmentedlist>
286
287 <variablelist>
288 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
289 <?dbfo list-presentation="list"?>
290 <?dbhtml list-presentation="table"?>
291
292 <varlistentry id="sudo_prog">
293 <term><command>sudo</command></term>
294 <listitem>
[bcd2922]295 <para>
296 executes a command as another user as permitted by
297 the <filename>/etc/sudoers</filename> configuration file.
[cf341b4]298 </para>
299 <indexterm zone="sudo sudo">
300 <primary sortas="b-sudo">sudo</primary>
301 </indexterm>
302 </listitem>
303 </varlistentry>
304
305 <varlistentry id="sudoedit">
306 <term><command>sudoedit</command></term>
307 <listitem>
[bcd2922]308 <para>
[a1e0f76]309 is a symlink to <command>sudo</command> that implies the
[bcd2922]310 <option>-e</option> option to invoke an editor as another user.
311 </para>
[cf341b4]312 <indexterm zone="sudo sudoedit">
313 <primary sortas="b-sudoedit">sudoedit</primary>
314 </indexterm>
315 </listitem>
316 </varlistentry>
317
[3c0f868f]318 <varlistentry id="visudo">
319 <term><command>visudo</command></term>
320 <listitem>
[bcd2922]321 <para>
322 allows for safer editing of the <filename>sudoers</filename>
323 file.
324 </para>
[3c0f868f]325 <indexterm zone="sudo visudo">
326 <primary sortas="b-visudo">visudo</primary>
327 </indexterm>
328 </listitem>
329 </varlistentry>
330
[61b8305]331 <varlistentry id="sudoreplay">
332 <term><command>sudoreplay</command></term>
333 <listitem>
[bcd2922]334 <para>
[0d7900a]335 is used to play back or list the output
[bcd2922]336 logs created by <command>sudo</command>.
337 </para>
[61b8305]338 <indexterm zone="sudo sudoreplay">
339 <primary sortas="b-sudoreplay">sudoreplay</primary>
340 </indexterm>
341 </listitem>
342 </varlistentry>
[3c0f868f]343
[cf341b4]344 </variablelist>
345
346 </sect2>
347
348</sect1>
Note: See TracBrowser for help on using the repository browser.