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