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