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