Imported Upstream version 1.7.4p6
[debian/sudo] / sudo.pod
index d17ed5909e065b6fc813fcec33b88dbc10b3796d..33bcb6a4ed2cd5268223763ac98e5ae9a8bb6354 100644 (file)
--- a/sudo.pod
+++ b/sudo.pod
@@ -1,4 +1,4 @@
-Copyright (c) 1994-1996, 1998-2005, 2007-2009
+Copyright (c) 1994-1996, 1998-2005, 2007-2010
        Todd C. Miller <Todd.Miller@courtesan.com>
 
 Permission to use, copy, modify, and distribute this software for any
@@ -30,28 +30,29 @@ B<sudo> B<-h> | B<-K> | B<-k> | B<-L> | B<-V>
 
 B<sudo> B<-v> [B<-AknS>]
 S<[B<-a> I<auth_type>]>
-S<[B<-p> I<prompt>]>
+S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
+S<[B<-u> I<username>|I<#uid>]>
 
 B<sudo> B<-l[l]> [B<-AknS>]
 S<[B<-a> I<auth_type>]>
-S<[B<-g> I<groupname>|I<#gid>]> S<[B<-p> I<prompt>]>
-S<[B<-U> I<username>]> S<[B<-u> I<username>|I<#uid>]> [I<command>]
+S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
+S<[B<-U> I<user name>]> S<[B<-u> I<user name>|I<#uid>]> [I<command>]
 
 B<sudo> [B<-AbEHnPS>]
 S<[B<-a> I<auth_type>]>
 S<[B<-C> I<fd>]>
 S<[B<-c> I<class>|I<->]>
-S<[B<-g> I<groupname>|I<#gid>]> S<[B<-p> I<prompt>]>
+S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
 S<[B<-r> I<role>]> S<[B<-t> I<type>]>
-S<[B<-u> I<username>|I<#uid>]>
+S<[B<-u> I<user name>|I<#uid>]>
 S<[B<VAR>=I<value>]> S<[B<-i> | B<-s>]> [I<command>]
 
 B<sudoedit> [B<-AnS>]
 S<[B<-a> I<auth_type>]>
 S<[B<-C> I<fd>]>
 S<[B<-c> I<class>|I<->]>
-S<[B<-g> I<groupname>|I<#gid>]> S<[B<-p> I<prompt>]>
-S<[B<-u> I<username>|I<#uid>]> file ...
+S<[B<-g> I<group name>|I<#gid>]> S<[B<-p> I<prompt>]>
+S<[B<-u> I<user name>|I<#uid>]> file ...
 
 =head1 DESCRIPTION
 
@@ -65,7 +66,7 @@ the same as the invoking user, no password is required.  Otherwise,
 B<sudo> requires that users authenticate themselves with a password
 by default (NOTE: in the default configuration this is the user's
 password, not the root password).  Once a user has been authenticated,
-a timestamp is updated and the user may then use sudo without a
+a time stamp is updated and the user may then use sudo without a
 password for a short period of time (C<@timeout@> minutes unless
 overridden in I<sudoers>).
 
@@ -74,10 +75,10 @@ is implied.
 
 B<sudo> determines who is an authorized user by consulting the file
 F<@sysconfdir@/sudoers>.  By running B<sudo> with the B<-v> option,
-a user can update the time stamp without running a I<command>. The
-password prompt itself will also time out if the user's password
-is not entered within C<@password_timeout@> minutes (unless overridden
-via I<sudoers>).
+a user can update the time stamp without running a I<command>.  If
+a password is required, B<sudo> will exit if the user's password
+is not entered within a configurable time limit.  The default
+password prompt timeout is C<@password_timeout@> minutes.
 
 If a user who is not listed in the I<sudoers> file tries to run a
 command via B<sudo>, mail is sent to the proper authorities, as
@@ -212,8 +213,11 @@ case, the primary group will be set to I<group>.
 
 The B<-H> (I<HOME>) option sets the C<HOME> environment variable
 to the homedir of the target user (root by default) as specified
-in passwd(5).  By default, B<sudo> does not modify C<HOME>
-(see I<set_home> and I<always_set_home> in L<sudoers(5)>).
+in passwd(5).  The default handling of the C<HOME> environment
+variable depends on L<sudoers(5)> settings.  By default, B<sudo>
+will set C<HOME> if I<env_reset> or I<always_set_home> are set, or
+if I<set_home> is set and the B<-s> option is specified on the
+command line.
 
 =item -h
 
@@ -229,36 +233,36 @@ it is passed to the shell for execution.  Otherwise, an interactive
 shell is executed.  B<sudo> attempts to change to that user's home
 directory before running the shell.  It also initializes the
 environment, leaving I<DISPLAY> and I<TERM> unchanged, setting
-I<HOME>, I<SHELL>, I<USER>, I<LOGNAME>, and I<PATH>, as well as
+I<HOME>, I<MAIL>, I<SHELL>, I<USER>, I<LOGNAME>, and I<PATH>, as well as
 the contents of F</etc/environment> on Linux and AIX systems.
 All other environment variables are removed.
 
 =item -K
 
 The B<-K> (sure I<kill>) option is like B<-k> except that it removes
-the user's timestamp entirely and may not be used in conjunction
+the user's time stamp entirely and may not be used in conjunction
 with a command or other option.  This option does not require a
 password.
 
 =item -k
 
 When used by itself, the B<-k> (I<kill>) option to B<sudo> invalidates
-the user's timestamp by setting the time on it to the Epoch.  The
+the user's time stamp by setting the time on it to the Epoch.  The
 next time B<sudo> is run a password will be required.  This option
 does not require a password and was added to allow a user to revoke
 B<sudo> permissions from a .logout file.
 
 When used in conjunction with a command or an option that may require
 a password, the B<-k> option will cause B<sudo> to ignore the user's
-timestamp file.  As a result, B<sudo> will prompt for a password
+time stamp file.  As a result, B<sudo> will prompt for a password
 (if one is required by I<sudoers>) and will not update the user's
-timestamp file.
+time stamp file.
 
 =item -L
 
-The B<-L> (I<list> defaults) option will list out the parameters
-that may be set in a I<Defaults> line along with a short description
-for each.  This option is useful in conjunction with L<grep(1)>.
+The B<-L> (I<list> defaults) option will list the parameters that
+may be set in a I<Defaults> line along with a short description for
+each.  This option will be removed from a future version of B<sudo>.
 
 =item -l[l] [I<command>]
 
@@ -296,13 +300,13 @@ escapes are supported:
 
 =item C<%H>
 
-expanded to the local hostname including the domain name
-(on if the machine's hostname is fully qualified or the I<fqdn>
+expanded to the local host name including the domain name
+(on if the machine's host name is fully qualified or the I<fqdn>
 I<sudoers> option is set)
 
 =item C<%h>
 
-expanded to the local hostname without the domain name
+expanded to the local host name without the domain name
 
 =item C<%p>
 
@@ -330,7 +334,7 @@ I<passprompt_override> flag is disabled in I<sudoers>.
 
 =item -r I<role>
 
-The B<-r> (I<role>) option causes the new (SELinux) security context to 
+The B<-r> (I<role>) option causes the new (SELinux) security context to
 have the role specified by I<role>.
 
 =item -S
@@ -348,7 +352,7 @@ for execution.  Otherwise, an interactive shell is executed.
 
 =item -t I<type>
 
-The B<-t> (I<type>) option causes the new (SELinux) security context to 
+The B<-t> (I<type>) option causes the new (SELinux) security context to
 have the type specified by I<type>.  If no type is specified, the default
 type is derived from the specified role.
 
@@ -379,7 +383,7 @@ with as well as the machine's local network addresses.
 =item -v
 
 If given the B<-v> (I<validate>) option, B<sudo> will update the
-user's timestamp, prompting for the user's password if necessary.
+user's time stamp, prompting for the user's password if necessary.
 This extends the B<sudo> timeout for another C<@timeout@> minutes
 (or whatever the timeout is set to in I<sudoers>) but does not run
 a command.
@@ -387,7 +391,7 @@ a command.
 =item --
 
 The B<--> option indicates that B<sudo> should stop processing command
-line arguments.  It is most useful in conjunction with the B<-s> option.
+line arguments.
 
 =back
 
@@ -455,29 +459,47 @@ PATH (if one or both are in the PATH).  Note, however, that the
 actual C<PATH> environment variable is I<not> modified and is passed
 unchanged to the program that B<sudo> executes.
 
-B<sudo> will check the ownership of its timestamp directory
+B<sudo> will check the ownership of its time stamp directory
 (F<@timedir@> by default) and ignore the directory's contents if
 it is not owned by root or if it is writable by a user other than
 root.  On systems that allow non-root users to give away files via
-L<chown(2)>, if the timestamp directory is located in a directory
+L<chown(2)>, if the time stamp directory is located in a directory
 writable by anyone (e.g., F</tmp>), it is possible for a user to
-create the timestamp directory before B<sudo> is run.  However,
+create the time stamp directory before B<sudo> is run.  However,
 because B<sudo> checks the ownership and mode of the directory and
 its contents, the only damage that can be done is to "hide" files
-by putting them in the timestamp dir.  This is unlikely to happen
-since once the timestamp dir is owned by root and inaccessible by
+by putting them in the time stamp dir.  This is unlikely to happen
+since once the time stamp dir is owned by root and inaccessible by
 any other user, the user placing files there would be unable to get
 them back out.  To get around this issue you can use a directory
-that is not world-writable for the timestamps (F</var/adm/sudo> for
+that is not world-writable for the time stamps (F</var/adm/sudo> for
 instance) or create F<@timedir@> with the appropriate owner (root)
 and permissions (0700) in the system startup files.
 
-B<sudo> will not honor timestamps set far in the future.
+B<sudo> will not honor time stamps set far in the future.
 Timestamps with a date greater than current_time + 2 * C<TIMEOUT>
 will be ignored and sudo will log and complain.  This is done to
-keep a user from creating his/her own timestamp with a bogus
+keep a user from creating his/her own time stamp with a bogus
 date on systems that allow users to give away files.
 
+On systems where the boot time is available, B<sudo> will also not
+honor time stamps from before the machine booted.
+
+Since time stamp files live in the file system, they can outlive a
+user's login session.  As a result, a user may be able to login,
+run a command with B<sudo> after authenticating, logout, login
+again, and run B<sudo> without authenticating so long as the time
+stamp file's modification time is within C<@timeout@> minutes (or
+whatever the timeout is set to in I<sudoers>).  When the I<tty_tickets>
+option is enabled in I<sudoers>, the time stamp has per-tty granularity
+but still may outlive the user's session.  On Linux systems where
+the devpts filesystem is used, Solaris systems with the devices
+filesystem, as well as other systems that utilize a devfs filesystem
+that monotonically increase the inode number of devices as they are
+created (such as Mac OS X), B<sudo> is able to determine when a
+tty-based time stamp file is stale and will ignore it.  Administrators
+should not rely on this feature as it is not universally available.
+
 Please note that B<sudo> will normally only log the command it
 explicitly runs.  If a user runs a command such as C<sudo su> or
 C<sudo sh>, subsequent commands run from that shell will I<not> be
@@ -500,10 +522,17 @@ B<sudo> utilizes the following environment variables:
 Default editor to use in B<-e> (sudoedit) mode if neither C<SUDO_EDITOR>
 nor C<VISUAL> is set
 
+=item C<MAIL>
+
+In B<-i> mode or when I<env_reset> is enabled in I<sudoers>, set
+to the mail spool of the target user
+
 =item C<HOME>
 
-In B<-s> or B<-H> mode (or if sudo was configured with the
---enable-shell-sets-home option), set to homedir of the target user
+Set to the home directory of the target user if B<-i> or B<-H> are
+specified, I<env_reset> or I<always_set_home> are set in I<sudoers>,
+or when the B<-s> option is specified and I<set_home> is set in
+I<sudoers>
 
 =item C<PATH>
 
@@ -567,7 +596,7 @@ List of who can run what
 
 =item F<@timedir@>
 
-Directory containing timestamps
+Directory containing time stamps
 
 =item F</etc/environment>