2005-11-23 14:12:35 +08:00
|
|
|
<?xml version="1.0" encoding="ISO-8859-1"?>
|
2007-04-05 03:42:53 +08:00
|
|
|
<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
|
|
|
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
2005-11-23 14:12:35 +08:00
|
|
|
<!ENTITY % general-entities SYSTEM "../../general.ent">
|
|
|
|
%general-entities;
|
|
|
|
|
2008-05-18 15:17:52 +08:00
|
|
|
<!ENTITY sudo-download-http "http://www.sudo.ws/sudo/dist/sudo-&sudo-version;.tar.gz">
|
2014-01-15 02:35:45 +08:00
|
|
|
<!ENTITY sudo-download-ftp "ftp://ftp.sudo.ws/pub/sudo/sudo-&sudo-version;.tar.gz">
|
2014-01-16 23:24:12 +08:00
|
|
|
<!ENTITY sudo-md5sum "a46f6de8645e6c5b6668d30657439d1c">
|
2013-10-02 17:39:34 +08:00
|
|
|
<!ENTITY sudo-size "2.1 MB">
|
2014-01-15 00:32:40 +08:00
|
|
|
<!ENTITY sudo-buildsize "24 MB (additional 1 MB for tests)">
|
|
|
|
<!ENTITY sudo-time "0.4 SBU">
|
2005-11-23 14:12:35 +08:00
|
|
|
]>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<sect1 id="sudo" xreflabel="Sudo-&sudo-version;">
|
2005-11-23 14:12:35 +08:00
|
|
|
<?dbhtml filename="sudo.html"?>
|
|
|
|
|
|
|
|
<sect1info>
|
2005-12-08 02:47:32 +08:00
|
|
|
<othername>$LastChangedBy$</othername>
|
|
|
|
<date>$Date$</date>
|
2005-11-23 14:12:35 +08:00
|
|
|
</sect1info>
|
|
|
|
|
|
|
|
<title>Sudo-&sudo-version;</title>
|
|
|
|
|
|
|
|
<indexterm zone="sudo">
|
2012-07-20 08:05:51 +08:00
|
|
|
<primary sortas="a-Sudo">Sudo</primary>
|
2005-11-23 14:12:35 +08:00
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
<sect2 role="package">
|
|
|
|
<title>Introduction to Sudo</title>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
The <application>Sudo</application> package allows a system administrator
|
|
|
|
to give certain users (or groups of users) the ability to run
|
|
|
|
some (or all) commands as
|
|
|
|
<systemitem class="username">root</systemitem> or another user while
|
|
|
|
logging the commands and arguments.
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
2013-08-18 04:38:01 +08:00
|
|
|
&lfs74_checked;
|
2010-09-26 10:31:37 +08:00
|
|
|
|
2005-11-23 14:12:35 +08:00
|
|
|
<bridgehead renderas="sect3">Package Information</bridgehead>
|
|
|
|
<itemizedlist spacing="compact">
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Download (HTTP): <ulink url="&sudo-download-http;"/>
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Download (FTP): <ulink url="&sudo-download-ftp;"/>
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Download MD5 sum: &sudo-md5sum;
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Download size: &sudo-size;
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Estimated disk space required: &sudo-buildsize;
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Estimated build time: &sudo-time;
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</listitem>
|
|
|
|
</itemizedlist>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect3">Sudo Dependencies</bridgehead>
|
|
|
|
|
|
|
|
<bridgehead renderas="sect4">Optional</bridgehead>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para role="optional">
|
|
|
|
<ulink url="http://www.openafs.org/">AFS</ulink>,
|
|
|
|
<ulink url="http://www.fwtk.org/">FWTK</ulink>,
|
|
|
|
<xref linkend="linux-pam"/>,
|
|
|
|
<xref linkend="mitkrb"/>,
|
|
|
|
an <xref linkend="server-mail"/> (that provides a
|
|
|
|
<command>sendmail</command> command),
|
|
|
|
<xref linkend="openldap"/>,
|
2013-12-11 17:46:03 +08:00
|
|
|
<ulink url="http://sourceforge.net/projects/opie/files/">Opie</ulink> and
|
2012-07-20 08:05:51 +08:00
|
|
|
<ulink url="http://www.rsa.com/node.aspx?id=1156">SecurID</ulink>
|
|
|
|
</para>
|
2006-01-18 09:44:31 +08:00
|
|
|
|
2006-04-11 02:38:22 +08:00
|
|
|
<para condition="html" role="usernotes">User Notes:
|
2012-07-20 08:05:51 +08:00
|
|
|
<ulink url="&blfs-wiki;/sudo"/>
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="installation">
|
|
|
|
<title>Installation of Sudo</title>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
2014-01-15 11:26:32 +08:00
|
|
|
Install <application>Sudo</application> by running the following commands:
|
2012-07-20 08:05:51 +08:00
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
2014-01-15 11:26:32 +08:00
|
|
|
<screen><userinput>./configure --prefix=/usr \
|
|
|
|
--libexecdir=/usr/lib \
|
|
|
|
--docdir=/usr/share/doc/sudo-&sudo-version; \
|
|
|
|
--with-timedir=/var/lib/sudo \
|
|
|
|
--with-all-insults \
|
2014-01-21 03:50:48 +08:00
|
|
|
--with-env-editor \
|
|
|
|
--with-passprompt="[BLFS sudo] password for %p"&&
|
2005-11-23 14:12:35 +08:00
|
|
|
make</userinput></screen>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
2014-01-15 00:32:40 +08:00
|
|
|
To test the results, issue: <command>env LC_ALL=C make check</command>.
|
2012-07-20 08:05:51 +08:00
|
|
|
</para>
|
2007-07-27 21:42:58 +08:00
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
Now, as the <systemitem class="username">root</systemitem> user:
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
|
|
|
<screen role="root"><userinput>make install</userinput></screen>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="commands">
|
|
|
|
<title>Command Explanations</title>
|
|
|
|
|
2013-06-27 01:32:24 +08:00
|
|
|
<para>
|
|
|
|
<option>--with-timedir=/var/lib/sudo</option>: This switch places
|
|
|
|
the variable time stamp files in a FHS compatible location.
|
|
|
|
</para>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
<option>--with-all-insults</option>: This switch includes all the
|
|
|
|
<application>sudo</application> insult sets.
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
2013-02-12 02:51:17 +08:00
|
|
|
<option>--with-env-editor</option>: This switch enables use of the
|
2012-07-20 08:05:51 +08:00
|
|
|
environment variable EDITOR for <command>visudo</command>.
|
|
|
|
</para>
|
2008-02-06 14:50:49 +08:00
|
|
|
|
2005-12-08 18:22:17 +08:00
|
|
|
<note>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
There are many options to <application>sudo</application>'s
|
|
|
|
<command>configure</command> command. Check the
|
|
|
|
<command>configure --help</command> output for a complete list.
|
|
|
|
</para>
|
2005-12-08 18:22:17 +08:00
|
|
|
</note>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="configuration">
|
|
|
|
<title>Configuring Sudo</title>
|
|
|
|
|
|
|
|
<sect3 id="sudo-config">
|
|
|
|
<title>Config File</title>
|
|
|
|
|
2013-06-27 02:30:40 +08:00
|
|
|
<para>
|
|
|
|
<filename>/etc/sudoers</filename>
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
|
|
|
<indexterm zone="sudo sudo-config">
|
|
|
|
<primary sortas="e-etc-sudoers">/etc/sudoers</primary>
|
|
|
|
</indexterm>
|
|
|
|
|
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3>
|
|
|
|
<title>Configuration Information</title>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
The <filename>sudoers</filename> file can be quite complicated. It
|
|
|
|
is composed of two types of entries: aliases (basically variables) and
|
|
|
|
user specifications (which specify who may run what). The installation
|
|
|
|
installs a default configuration that has no privileges installed for any
|
|
|
|
user.
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
One example usage is to allow the system administrator to execute
|
|
|
|
any program without typing a password each time root privileges are
|
|
|
|
needed. This can be configured as:
|
|
|
|
</para>
|
2005-11-30 03:07:13 +08:00
|
|
|
|
2008-08-18 00:30:40 +08:00
|
|
|
<screen># User alias specification
|
2005-11-23 14:12:35 +08:00
|
|
|
User_Alias ADMIN = YourLoginId
|
|
|
|
|
|
|
|
# Allow people in group ADMIN to run all commands without a password
|
|
|
|
ADMIN ALL = NOPASSWD: ALL</screen>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
For details, see <command>man sudoers</command>.
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
|
2005-12-22 11:32:33 +08:00
|
|
|
<note>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
The <application>Sudo</application> developers highly recommend
|
|
|
|
using the <command>visudo</command> program to edit the
|
|
|
|
<filename>sudoers</filename> file. This will provide basic sanity
|
|
|
|
checking like syntax parsing and file permission to avoid some possible
|
|
|
|
mistakes that could lead to a vulnerable configuration.
|
|
|
|
</para>
|
2005-12-22 11:32:33 +08:00
|
|
|
</note>
|
|
|
|
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
If you've built <application>Sudo</application> with
|
|
|
|
<application>PAM</application> support, issue the following
|
|
|
|
command as the <systemitem class="username">root</systemitem> user
|
|
|
|
to create the <application>PAM</application> configuration file:
|
|
|
|
</para>
|
2008-02-06 14:50:49 +08:00
|
|
|
|
2013-08-14 16:41:08 +08:00
|
|
|
<screen role="root"><userinput>cat > /etc/pam.d/sudo << "EOF"
|
|
|
|
<literal># Begin /etc/pam.d/sudo
|
2010-09-25 22:37:49 +08:00
|
|
|
|
|
|
|
# include the default auth settings
|
|
|
|
auth include system-auth
|
|
|
|
|
|
|
|
# include the default account settings
|
|
|
|
account include system-account
|
|
|
|
|
|
|
|
# Set default environment variables for the service user
|
|
|
|
session required pam_env.so
|
|
|
|
|
|
|
|
# include system session defaults
|
|
|
|
session include system-session
|
|
|
|
|
2013-08-14 16:41:08 +08:00
|
|
|
# End /etc/pam.d/sudo</literal>
|
2010-09-25 22:37:49 +08:00
|
|
|
EOF
|
|
|
|
chmod 644 /etc/pam.d/sudo</userinput></screen>
|
2008-05-09 20:42:27 +08:00
|
|
|
|
2005-11-23 14:12:35 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
<sect2 role="content">
|
|
|
|
<title>Contents</title>
|
|
|
|
|
|
|
|
<segmentedlist>
|
|
|
|
<segtitle>Installed Programs</segtitle>
|
2013-06-27 02:30:40 +08:00
|
|
|
<segtitle>Installed Libraries</segtitle>
|
2005-11-23 14:12:35 +08:00
|
|
|
<segtitle>Installed Directories</segtitle>
|
|
|
|
|
|
|
|
<seglistitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<seg>
|
2014-01-15 00:32:40 +08:00
|
|
|
sudo, sudoedit (symlink), sudoreplay, and visudo
|
2012-07-20 08:05:51 +08:00
|
|
|
</seg>
|
|
|
|
<seg>
|
2014-01-15 00:32:40 +08:00
|
|
|
group_file.so, sudoers.so, sudo_noexec.so, and system_group.so
|
2012-07-20 08:05:51 +08:00
|
|
|
</seg>
|
|
|
|
<seg>
|
2013-06-27 02:30:40 +08:00
|
|
|
/etc/sudoers.d,
|
|
|
|
/usr/lib/sudo,
|
|
|
|
/usr/share/doc/sudo-&sudo-version;, and
|
|
|
|
/var/lib/sudo
|
2012-07-20 08:05:51 +08:00
|
|
|
</seg>
|
2005-11-23 14:12:35 +08:00
|
|
|
</seglistitem>
|
|
|
|
</segmentedlist>
|
|
|
|
|
|
|
|
<variablelist>
|
|
|
|
<bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
|
|
|
<?dbfo list-presentation="list"?>
|
|
|
|
<?dbhtml list-presentation="table"?>
|
|
|
|
|
|
|
|
<varlistentry id="sudo_prog">
|
|
|
|
<term><command>sudo</command></term>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
executes a command as another user as permitted by
|
|
|
|
the <filename>/etc/sudoers</filename> configuration file.
|
2005-11-23 14:12:35 +08:00
|
|
|
</para>
|
|
|
|
<indexterm zone="sudo sudo">
|
|
|
|
<primary sortas="b-sudo">sudo</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
|
|
|
<varlistentry id="sudoedit">
|
|
|
|
<term><command>sudoedit</command></term>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
2014-01-15 00:32:40 +08:00
|
|
|
is a symlink to <command>sudo</command> that implies the
|
2012-07-20 08:05:51 +08:00
|
|
|
<option>-e</option> option to invoke an editor as another user.
|
|
|
|
</para>
|
2005-11-23 14:12:35 +08:00
|
|
|
<indexterm zone="sudo sudoedit">
|
|
|
|
<primary sortas="b-sudoedit">sudoedit</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2005-12-22 11:32:33 +08:00
|
|
|
<varlistentry id="visudo">
|
|
|
|
<term><command>visudo</command></term>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
|
|
|
allows for safer editing of the <filename>sudoers</filename>
|
|
|
|
file.
|
|
|
|
</para>
|
2005-12-22 11:32:33 +08:00
|
|
|
<indexterm zone="sudo visudo">
|
|
|
|
<primary sortas="b-visudo">visudo</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
|
2012-03-15 05:35:12 +08:00
|
|
|
<varlistentry id="sudoreplay">
|
|
|
|
<term><command>sudoreplay</command></term>
|
|
|
|
<listitem>
|
2012-07-20 08:05:51 +08:00
|
|
|
<para>
|
2013-02-12 02:51:17 +08:00
|
|
|
is used to play back or list the output
|
2012-07-20 08:05:51 +08:00
|
|
|
logs created by <command>sudo</command>.
|
|
|
|
</para>
|
2012-03-15 05:35:12 +08:00
|
|
|
<indexterm zone="sudo sudoreplay">
|
|
|
|
<primary sortas="b-sudoreplay">sudoreplay</primary>
|
|
|
|
</indexterm>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
2005-12-22 11:32:33 +08:00
|
|
|
|
2005-11-23 14:12:35 +08:00
|
|
|
</variablelist>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|
|
|
|
</sect1>
|