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