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