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