source: postlfs/security/sudo.xml@ 7afe2f1f

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 7.10 7.4 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 7afe2f1f was 7afe2f1f, checked in by Thomas Trepl <thomas@…>, 13 years ago

Update sudo, fcron

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

  • Property mode set to 100644
File size: 10.0 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.twaren.net/Unix/Security/Sudo/sudo-&sudo-version;.tar.gz">
9 <!ENTITY sudo-md5sum "4c8105507363371dea89ceb7c92187dd">
10 <!ENTITY sudo-size "943 KB">
11 <!ENTITY sudo-buildsize "5 MB">
12 <!ENTITY sudo-time "0.1 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>The <application>sudo</application> package allows a system
33 administrator to give certain users (or groups of users) the ability to run
34 some (or all) commands as
35 <systemitem class="username">root</systemitem> or another user while
36 logging the commands and arguments.</para>
37
38 &lfs67_checked;
39
40 <bridgehead renderas="sect3">Package Information</bridgehead>
41 <itemizedlist spacing="compact">
42 <listitem>
43 <para>Download (HTTP): <ulink url="&sudo-download-http;"/></para>
44 </listitem>
45 <listitem>
46 <para>Download (FTP): <ulink url="&sudo-download-ftp;"/></para>
47 </listitem>
48 <listitem>
49 <para>Download MD5 sum: &sudo-md5sum;</para>
50 </listitem>
51 <listitem>
52 <para>Download size: &sudo-size;</para>
53 </listitem>
54 <listitem>
55 <para>Estimated disk space required: &sudo-buildsize;</para>
56 </listitem>
57 <listitem>
58 <para>Estimated build time: &sudo-time;</para>
59 </listitem>
60 </itemizedlist>
61
62<!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
63 <itemizedlist spacing='compact'>
64 <listitem>
65 <para>Required patch: <ulink
66 url="&patch-root;/sudo-&sudo-version;-envvar_fix-1.patch"/></para>
67 </listitem>
68 </itemizedlist> -->
69
70
71 <bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
72
73 <bridgehead renderas="sect4">Optional</bridgehead>
74 <para role="optional"><xref linkend="linux-pam"/>,
75 <ulink url="ftp://ftp.nrl.navy.mil/pub/security/opie">Opie</ulink>,
76 <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>,
77 <ulink url="http://www.fwtk.org/">FWTK</ulink>,
78 an <xref linkend="server-mail"/> (that provides a
79 <command>sendmail</command> command),
80 <ulink url="http://www.pdc.kth.se/kth-krb/">krb4</ulink>,
81 <xref linkend="heimdal"/> or <xref linkend="mitkrb"/>,
82 <xref linkend="openldap"/>, and
83 <ulink url="http://www.openafs.org/">AFS</ulink></para>
84
85 <para condition="html" role="usernotes">User Notes:
86 <ulink url="&blfs-wiki;/sudo"/></para>
87
88 </sect2>
89
90 <sect2 role="installation">
91 <title>Installation of Sudo</title>
92
93 <para>Install <application>sudo</application> by running
94 the following commands:</para>
95
96<!-- <screen><userinput>patch -Np1 -i ../sudo-&sudo-version;-envvar_fix-1.patch &amp;&amp;
97-->
98<screen><userinput>./configure --prefix=/usr \
99 --libexecdir=/usr/lib \
100 --with-ignore-dot \
101 --with-all-insults \
102 --enable-shell-sets-home \
103 --disable-root-sudo \
104 --with-logfac=auth \
105 --without-pam \
106 --without-sendmail &amp;&amp;
107make</userinput></screen>
108
109 <para>This package does not come with a test suite.</para>
110
111 <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
112
113<screen role="root"><userinput>make install</userinput></screen>
114
115 </sect2>
116
117 <sect2 role="commands">
118 <title>Command Explanations</title>
119
120 <para><option>--with-ignore-dot</option>: This switch causes
121 <application>sudo</application> to ignore '.' in the PATH.</para>
122
123 <para><option>--with-all-insults</option>: This switch includes all the
124 <application>sudo</application> insult sets.</para>
125
126 <para><option>--enable-shell-sets-home</option>: This switch sets HOME to
127 the target user in shell mode.</para>
128
129 <para><option>--disable-root-sudo</option>: This switch keeps the
130 <systemitem class="username">root</systemitem> user from running sudo,
131 preventing users from chaining commands to get a root shell.</para>
132
133 <para><option>--with-logfac=auth</option>: This switch forces use of the
134 auth facility for logging.</para>
135
136 <para><option>--without-pam</option>: This switch disables the use of
137 <application>PAM</application> authentication. Omit if you have
138 <application>PAM</application> installed.</para>
139
140 <para><option>--without-sendmail</option>: This switch disables the use of
141 sendmail. Remove if you have a sendmail compatible MTA.</para>
142
143 <para><option>--enable-noargs-shell</option>: This switch allows
144 <application>sudo</application> to run a shell if invoked with no
145 arguments.</para>
146
147 <note>
148 <para>There are many options to <application>sudo</application>'s
149 <command>configure</command> command. Check the
150 <command>configure --help</command> output for a complete list.</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><filename>/etc/sudoers</filename></para>
162
163 <indexterm zone="sudo sudo-config">
164 <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
165 </indexterm>
166
167 </sect3>
168
169 <sect3>
170 <title>Configuration Information</title>
171
172 <para>The <filename>sudoers</filename> file can be quite complicated. It
173 is composed of two types of entries: aliases (basically variables) and
174 user specifications (which specify who may run what). The installation
175 installs a default configuration that has no privileges installed for any
176 user.</para>
177
178 <para>One example usage is to allow the system administrator to execute
179 any program without typing a password each time root privileges are
180 needed. This can be configured as:</para>
181
182<screen># User alias specification
183User_Alias ADMIN = YourLoginId
184
185# Allow people in group ADMIN to run all commands without a password
186ADMIN ALL = NOPASSWD: ALL</screen>
187
188 <para>For details, see <command>man sudoers</command>.</para>
189
190 <note>
191 <para>The <application>Sudo</application> developers highly recommend
192 using the <command>visudo</command> program to edit the
193 <filename>sudoers</filename> file. This will provide basic sanity
194 checking like syntax parsing and file permission to avoid some possible
195 mistakes that could lead to a vulnerable configuration.</para>
196 </note>
197
198 <para>If you've built <application>Sudo</application> with
199 <application>PAM</application> support, issue the following
200 command as the <systemitem class="username">root</systemitem> user
201 to create the <application>PAM</application> configuration file:</para>
202
203<screen role="root"><userinput>cat &gt; /etc/pam.d/sudo &lt;&lt; "EOF" &amp;&amp;
204# Begin /etc/pam.d/sudo
205
206# include the default auth settings
207auth include system-auth
208
209# include the default account settings
210account include system-account
211
212# Use xauth keys (if available)
213session optional pam_xauth.so
214
215# Set default environment variables for the service user
216session required pam_env.so
217
218# include system session defaults
219session include system-session
220
221# End /etc/pam.d/sudo
222EOF
223chmod 644 /etc/pam.d/sudo</userinput></screen>
224
225 </sect3>
226
227 </sect2>
228
229 <sect2 role="content">
230 <title>Contents</title>
231
232 <segmentedlist>
233 <segtitle>Installed Programs</segtitle>
234 <segtitle>Installed Library</segtitle>
235 <segtitle>Installed Directories</segtitle>
236
237 <seglistitem>
238 <seg>sudo, sudoedit, and visudo</seg>
239 <seg>sudo_noexec.so</seg>
240 <seg>None</seg>
241 </seglistitem>
242 </segmentedlist>
243
244 <variablelist>
245 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
246 <?dbfo list-presentation="list"?>
247 <?dbhtml list-presentation="table"?>
248
249 <varlistentry id="sudo_prog">
250 <term><command>sudo</command></term>
251 <listitem>
252 <para>executes a command as another user as permitted by
253 the <filename>/etc/sudoers</filename> configuration file.
254 </para>
255 <indexterm zone="sudo sudo">
256 <primary sortas="b-sudo">sudo</primary>
257 </indexterm>
258 </listitem>
259 </varlistentry>
260
261 <varlistentry id="sudoedit">
262 <term><command>sudoedit</command></term>
263 <listitem>
264 <para>is a hard link to <command>sudo</command> that implies
265 the <option>-e</option> option to invoke an editor as another
266 user.</para>
267 <indexterm zone="sudo sudoedit">
268 <primary sortas="b-sudoedit">sudoedit</primary>
269 </indexterm>
270 </listitem>
271 </varlistentry>
272
273 <varlistentry id="visudo">
274 <term><command>visudo</command></term>
275 <listitem>
276 <para>allows for safer editing of the <filename>sudoers</filename>
277 file.</para>
278 <indexterm zone="sudo visudo">
279 <primary sortas="b-visudo">visudo</primary>
280 </indexterm>
281 </listitem>
282 </varlistentry>
283
284
285 <varlistentry id="sudo_noexec">
286 <term><filename class='libraryfile'>sudo_noexec.so</filename></term>
287 <listitem>
288 <para>enables support for the "noexec" functionality which prevents
289 a dynamically-linked program being run by sudo from executing
290 another program (think shell escapes).</para>
291 <indexterm zone="sudo sudo_noexec">
292 <primary sortas="c-sudo_noexec">sudo_noexec.so</primary>
293 </indexterm>
294 </listitem>
295 </varlistentry>
296
297 </variablelist>
298
299 </sect2>
300
301</sect1>
Note: See TracBrowser for help on using the repository browser.