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