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 "b9be6df7ecefedff2263052ed9fc5e93">
|
---|
10 | <!ENTITY sudo-size "1.5 MB">
|
---|
11 | <!ENTITY sudo-buildsize "16 MB">
|
---|
12 | <!ENTITY sudo-time "0.3 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 | &lfs70_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">Sudo Dependencies</bridgehead>
|
---|
63 |
|
---|
64 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
65 | <para role="optional"><ulink url="http://www.openafs.org/">AFS</ulink>,
|
---|
66 | <xref linkend="linux-pam"/>,
|
---|
67 | <ulink url="http://www.fwtk.org/">FWTK</ulink>,
|
---|
68 | <xref linkend="mitkrb"/>,
|
---|
69 | an <xref linkend="server-mail"/> (that provides a
|
---|
70 | <command>sendmail</command> command),
|
---|
71 | <xref linkend="openldap"/>,
|
---|
72 | <ulink url="ftp://ftp.nrl.navy.mil/pub/security/opie">Opie</ulink> and
|
---|
73 | <ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink></para>
|
---|
74 |
|
---|
75 | <para condition="html" role="usernotes">User Notes:
|
---|
76 | <ulink url="&blfs-wiki;/sudo"/></para>
|
---|
77 |
|
---|
78 | </sect2>
|
---|
79 |
|
---|
80 | <sect2 role="installation">
|
---|
81 | <title>Installation of Sudo</title>
|
---|
82 |
|
---|
83 | <para>Install <application>sudo</application> by running
|
---|
84 | the following commands:</para>
|
---|
85 |
|
---|
86 | <screen><userinput>./configure --prefix=/usr \
|
---|
87 | --libexecdir=/usr/lib/sudo \
|
---|
88 | --with-all-insults \
|
---|
89 | --with-env-editor \
|
---|
90 | --without-pam \
|
---|
91 | --without-sendmail &&
|
---|
92 | make</userinput></screen>
|
---|
93 |
|
---|
94 | <para>This package does not come with a test suite.</para>
|
---|
95 |
|
---|
96 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
97 |
|
---|
98 | <screen role="root"><userinput>make install</userinput></screen>
|
---|
99 |
|
---|
100 | </sect2>
|
---|
101 |
|
---|
102 | <sect2 role="commands">
|
---|
103 | <title>Command Explanations</title>
|
---|
104 |
|
---|
105 | <para><option>--with-all-insults</option>: This switch includes all the
|
---|
106 | <application>sudo</application> insult sets.</para>
|
---|
107 |
|
---|
108 | <para><option>--with-env-editor</option>: This switch enables use of the
|
---|
109 | environment variable EDITOR for <command>visudo</command>.</para>
|
---|
110 |
|
---|
111 | <para><option>--without-pam</option>: This switch disables the use of
|
---|
112 | <application>PAM</application> authentication. Omit if you have
|
---|
113 | <application>Linux PAM</application> installed.</para>
|
---|
114 |
|
---|
115 | <para><option>--without-sendmail</option>: This switch disables the use of
|
---|
116 | sendmail. Remove if you have a sendmail compatible MTA.</para>
|
---|
117 |
|
---|
118 | <note>
|
---|
119 | <para>There are many options to <application>sudo</application>'s
|
---|
120 | <command>configure</command> command. Check the
|
---|
121 | <command>configure --help</command> output for a complete list.</para>
|
---|
122 | </note>
|
---|
123 |
|
---|
124 | </sect2>
|
---|
125 |
|
---|
126 | <sect2 role="configuration">
|
---|
127 | <title>Configuring Sudo</title>
|
---|
128 |
|
---|
129 | <sect3 id="sudo-config">
|
---|
130 | <title>Config File</title>
|
---|
131 |
|
---|
132 | <para><filename>/etc/sudoers</filename></para>
|
---|
133 |
|
---|
134 | <indexterm zone="sudo sudo-config">
|
---|
135 | <primary sortas="e-etc-sudoers">/etc/sudoers</primary>
|
---|
136 | </indexterm>
|
---|
137 |
|
---|
138 | </sect3>
|
---|
139 |
|
---|
140 | <sect3>
|
---|
141 | <title>Configuration Information</title>
|
---|
142 |
|
---|
143 | <para>The <filename>sudoers</filename> file can be quite complicated. It
|
---|
144 | is composed of two types of entries: aliases (basically variables) and
|
---|
145 | user specifications (which specify who may run what). The installation
|
---|
146 | installs a default configuration that has no privileges installed for any
|
---|
147 | user.</para>
|
---|
148 |
|
---|
149 | <para>One example usage is to allow the system administrator to execute
|
---|
150 | any program without typing a password each time root privileges are
|
---|
151 | needed. This can be configured as:</para>
|
---|
152 |
|
---|
153 | <screen># User alias specification
|
---|
154 | User_Alias ADMIN = YourLoginId
|
---|
155 |
|
---|
156 | # Allow people in group ADMIN to run all commands without a password
|
---|
157 | ADMIN ALL = NOPASSWD: ALL</screen>
|
---|
158 |
|
---|
159 | <para>For details, see <command>man sudoers</command>.</para>
|
---|
160 |
|
---|
161 | <note>
|
---|
162 | <para>The <application>Sudo</application> developers highly recommend
|
---|
163 | using the <command>visudo</command> program to edit the
|
---|
164 | <filename>sudoers</filename> file. This will provide basic sanity
|
---|
165 | checking like syntax parsing and file permission to avoid some possible
|
---|
166 | mistakes that could lead to a vulnerable configuration.</para>
|
---|
167 | </note>
|
---|
168 |
|
---|
169 | <para>If you've built <application>Sudo</application> with
|
---|
170 | <application>PAM</application> support, issue the following
|
---|
171 | command as the <systemitem class="username">root</systemitem> user
|
---|
172 | to create the <application>PAM</application> configuration file:</para>
|
---|
173 |
|
---|
174 | <screen role="root"><userinput>cat > /etc/pam.d/sudo << "EOF" &&
|
---|
175 | # Begin /etc/pam.d/sudo
|
---|
176 |
|
---|
177 | # include the default auth settings
|
---|
178 | auth include system-auth
|
---|
179 |
|
---|
180 | # include the default account settings
|
---|
181 | account include system-account
|
---|
182 |
|
---|
183 | # Set default environment variables for the service user
|
---|
184 | session required pam_env.so
|
---|
185 |
|
---|
186 | # include system session defaults
|
---|
187 | session include system-session
|
---|
188 |
|
---|
189 | # End /etc/pam.d/sudo
|
---|
190 | EOF
|
---|
191 | chmod 644 /etc/pam.d/sudo</userinput></screen>
|
---|
192 |
|
---|
193 | </sect3>
|
---|
194 |
|
---|
195 | </sect2>
|
---|
196 |
|
---|
197 | <sect2 role="content">
|
---|
198 | <title>Contents</title>
|
---|
199 |
|
---|
200 | <segmentedlist>
|
---|
201 | <segtitle>Installed Programs</segtitle>
|
---|
202 | <segtitle>Installed Library</segtitle>
|
---|
203 | <segtitle>Installed Directories</segtitle>
|
---|
204 |
|
---|
205 | <seglistitem>
|
---|
206 | <seg>sudo, sudoedit, sudoreplay and visudo</seg>
|
---|
207 | <seg>sudoers.so and sudo_noexec.so</seg>
|
---|
208 | <seg>None</seg>
|
---|
209 | </seglistitem>
|
---|
210 | </segmentedlist>
|
---|
211 |
|
---|
212 | <variablelist>
|
---|
213 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
214 | <?dbfo list-presentation="list"?>
|
---|
215 | <?dbhtml list-presentation="table"?>
|
---|
216 |
|
---|
217 | <varlistentry id="sudo_prog">
|
---|
218 | <term><command>sudo</command></term>
|
---|
219 | <listitem>
|
---|
220 | <para>executes a command as another user as permitted by
|
---|
221 | the <filename>/etc/sudoers</filename> configuration file.
|
---|
222 | </para>
|
---|
223 | <indexterm zone="sudo sudo">
|
---|
224 | <primary sortas="b-sudo">sudo</primary>
|
---|
225 | </indexterm>
|
---|
226 | </listitem>
|
---|
227 | </varlistentry>
|
---|
228 |
|
---|
229 | <varlistentry id="sudoedit">
|
---|
230 | <term><command>sudoedit</command></term>
|
---|
231 | <listitem>
|
---|
232 | <para>is a hard link to <command>sudo</command> that implies
|
---|
233 | the <option>-e</option> option to invoke an editor as another
|
---|
234 | user.</para>
|
---|
235 | <indexterm zone="sudo sudoedit">
|
---|
236 | <primary sortas="b-sudoedit">sudoedit</primary>
|
---|
237 | </indexterm>
|
---|
238 | </listitem>
|
---|
239 | </varlistentry>
|
---|
240 |
|
---|
241 | <varlistentry id="visudo">
|
---|
242 | <term><command>visudo</command></term>
|
---|
243 | <listitem>
|
---|
244 | <para>allows for safer editing of the <filename>sudoers</filename>
|
---|
245 | file.</para>
|
---|
246 | <indexterm zone="sudo visudo">
|
---|
247 | <primary sortas="b-visudo">visudo</primary>
|
---|
248 | </indexterm>
|
---|
249 | </listitem>
|
---|
250 | </varlistentry>
|
---|
251 |
|
---|
252 | <varlistentry id="sudoreplay">
|
---|
253 | <term><command>sudoreplay</command></term>
|
---|
254 | <listitem>
|
---|
255 | <para>is used to play back or list the output
|
---|
256 | logs created by <command>sudo</command>.</para>
|
---|
257 | <indexterm zone="sudo sudoreplay">
|
---|
258 | <primary sortas="b-sudoreplay">sudoreplay</primary>
|
---|
259 | </indexterm>
|
---|
260 | </listitem>
|
---|
261 | </varlistentry>
|
---|
262 |
|
---|
263 | <varlistentry id="sudoers">
|
---|
264 | <term><filename class='libraryfile'>sudoers.so</filename></term>
|
---|
265 | <listitem>
|
---|
266 | <para>is default sudo security policy module.</para>
|
---|
267 | <indexterm zone="sudo sudoers">
|
---|
268 | <primary sortas="c-sudoers">sudoers.so</primary>
|
---|
269 | </indexterm>
|
---|
270 | </listitem>
|
---|
271 | </varlistentry>
|
---|
272 |
|
---|
273 | <varlistentry id="sudo_noexec">
|
---|
274 | <term><filename class='libraryfile'>sudo_noexec.so</filename></term>
|
---|
275 | <listitem>
|
---|
276 | <para>enables support for the "noexec" functionality which prevents
|
---|
277 | a dynamically-linked program being run by sudo from executing
|
---|
278 | another program (think shell escapes).</para>
|
---|
279 | <indexterm zone="sudo sudo_noexec">
|
---|
280 | <primary sortas="c-sudo_noexec">sudo_noexec.so</primary>
|
---|
281 | </indexterm>
|
---|
282 | </listitem>
|
---|
283 | </varlistentry>
|
---|
284 |
|
---|
285 | </variablelist>
|
---|
286 |
|
---|
287 | </sect2>
|
---|
288 |
|
---|
289 | </sect1>
|
---|