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