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 password for a short
- period of time (`5' minutes unless overridden in _\bs_\bu_\bd_\bo_\be_\br_\bs).
+ period of time (5 minutes unless overridden in _\bs_\bu_\bd_\bo_\be_\br_\bs).
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo determines who is an authorized user by consulting
the file _\b/_\be_\bt_\bc_\b/_\bs_\bu_\bd_\bo_\be_\br_\bs. By giving s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo the -\b-\b-\b-v\bv\bv\bv flag a user
can update the time stamp without running a _\bc_\bo_\bm_\bm_\ba_\bn_\bd_\b. The
password prompt itself will also time out if the user's
- password is not entered within `5' minutes (unless over
- ridden via _\bs_\bu_\bd_\bo_\be_\br_\bs).
+ password is not entered within 5 minutes (unless overrid
+ den via _\bs_\bu_\bd_\bo_\be_\br_\bs).
If a user who is not listed in the _\bs_\bu_\bd_\bo_\be_\br_\bs file tries to
run a command via s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo, mail is sent to the proper author
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo accepts the following command line options:
-V The -\b-\b-\b-V\bV\bV\bV (_\bv_\be_\br_\bs_\bi_\bo_\bn) option causes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to print the ver
- sion number and exit.
+ sion number and exit. If the invoking user is already
+ root the -\b-\b-\b-V\bV\bV\bV option will print out a list of the
+ defaults s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo was compiled with as well as the
+ machine's local network addresses.
-l The -\b-\b-\b-l\bl\bl\bl (_\bl_\bi_\bs_\bt) option will list out the allowed (and
forbidden) commands for the user on the current host.
- -L The -\b-\b-\b-L\bL\bL\bL (_\bl_\bi_\bs_\bt defaults) option will list out the param
- eters that may be set in a _\bD_\be_\bf_\ba_\bu_\bl_\bt_\bs line along with a
- short description for each. This option is useful in
- conjunction with _\bg_\br_\be_\bp(1).
-December 29, 2000 1.6.4 1
+
+December 14, 2001 1.6.4 1
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ -L The -\b-\b-\b-L\bL\bL\bL (_\bl_\bi_\bs_\bt defaults) option will list out the param
+ eters that may be set in a _\bD_\be_\bf_\ba_\bu_\bl_\bt_\bs line along with a
+ short description for each. This option is useful in
+ conjunction with _\bg_\br_\be_\bp(1).
+
-h The -\b-\b-\b-h\bh\bh\bh (_\bh_\be_\bl_\bp) option causes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to print a usage mes
sage and exit.
-v If given the -\b-\b-\b-v\bv\bv\bv (_\bv_\ba_\bl_\bi_\bd_\ba_\bt_\be) option, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will update
the user's timestamp, prompting for the user's pass
word if necessary. This extends the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo timeout for
- another `5' minutes (or whatever the timeout is set to
+ another 5 minutes (or whatever the timeout is set to
in _\bs_\bu_\bd_\bo_\be_\br_\bs) but does not run a command.
-k The -\b-\b-\b-k\bk\bk\bk (_\bk_\bi_\bl_\bl) option to s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo invalidates the user's
-p The -\b-\b-\b-p\bp\bp\bp (_\bp_\br_\bo_\bm_\bp_\bt) option allows you to override the
default password prompt and use a custom one. If the
- password prompt contains the `%u' escape, `%u' will be
- replaced with the user's login name. Similarly, `%h'
+ password prompt contains the %u escape, %u will be
+ replaced with the user's login name. Similarly, %h
will be replaced with the local hostname.
-c The -\b-\b-\b-c\bc\bc\bc (_\bc_\bl_\ba_\bs_\bs) option causes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to run the specified
command with resources limited by the specified login
class. The _\bc_\bl_\ba_\bs_\bs argument can be either a class name
as defined in /etc/login.conf, or a single '-' charac
- ter. Specifying a _\bc_\bl_\ba_\bs_\bs of `-' indicates that the
- command should be run restricted by the default login
+ ter. Specifying a _\bc_\bl_\ba_\bs_\bs of - indicates that the com
+ mand should be run restricted by the default login
capabilities for the user the command is run as. If
the _\bc_\bl_\ba_\bs_\bs argument specifies an existing user class,
the command must be run as root, or the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo command
the specified authentication type when validating the
user, as allowed by /etc/login.conf. The system
administrator may specify a list of sudo-specific
- authentication methods by adding an "auth-sudo" entry
- in /etc/login.conf. This option is only available on
- systems that support BSD authentication where s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo has
- been configured with the --with-bsdauth option.
-
-December 29, 2000 1.6.4 2
+December 14, 2001 1.6.4 2
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ authentication methods by adding an "auth-sudo" entry
+ in /etc/login.conf. This option is only available on
+ systems that support BSD authentication where s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo has
+ been configured with the --with-bsdauth option.
+
-u The -\b-\b-\b-u\bu\bu\bu (_\bu_\bs_\be_\br) option causes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to run the specified
command as a user other than _\br_\bo_\bo_\bt. To specify a _\bu_\bi_\bd
instead of a _\bu_\bs_\be_\br_\bn_\ba_\bm_\be, use _\b#_\bu_\bi_\bd.
_\bS_\bH_\bE_\bL_\bL environment variable if it is set or the shell
as specified in _\bp_\ba_\bs_\bs_\bw_\bd(4).
- -H The -\b-\b-\b-H\bH\bH\bH (_\bH_\bO_\bM_\bE) option sets the `HOME' environment vari
+ -H The -\b-\b-\b-H\bH\bH\bH (_\bH_\bO_\bM_\bE) option sets the HOME environment vari
able to the homedir of the target user (root by
default) as specified in _\bp_\ba_\bs_\bs_\bw_\bd(4). By default, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo
- does not modify `HOME'.
+ does not modify HOME.
-S The -\b-\b-\b-S\bS\bS\bS (_\bs_\bt_\bd_\bi_\bn) option causes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to read the password
from standard input instead of the terminal device.
a configuration/permission problem or if s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot exe
cute the given command. In the latter case the error
string is printed to stderr. If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo cannot _\bs_\bt_\ba_\bt(2) one
- or more entries in the user's `PATH' an error is printed
- on stderr. (If the directory does not exist or if it is
- not really a directory, the entry is ignored and no error
- is printed.) This should not happen under normal circum
+ or more entries in the user's PATH an error is printed on
+ stderr. (If the directory does not exist or if it is not
+ really a directory, the entry is ignored and no error is
+ printed.) This should not happen under normal circum
stances. The most common reason for _\bs_\bt_\ba_\bt(2) to return
"permission denied" is if you are running an automounter
- and one of the directories in your `PATH' is on a machine
+ and one of the directories in your PATH is on a machine
that is currently unreachable.
S\bS\bS\bSE\bE\bE\bEC\bC\bC\bCU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIT\bT\bT\bTY\bY\bY\bY N\bN\bN\bNO\bO\bO\bOT\bT\bT\bTE\bE\bE\bES\bS\bS\bS
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo tries to be safe when executing external commands.
Variables that control how dynamic loading and binding is
done can be used to subvert the program that s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo runs.
- To combat this the `LD_*', `_RLD_*', `SHLIB_PATH' (HP-UX
- only), and `LIBPATH' (AIX only) environment variables are
- removed from the environment passed on to all commands
- executed. s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will also remove the `IFS', `ENV',
- `BASH_ENV', `KRB_CONF', `KRBCONFDIR', `KRBTKFILE',
- `KRB5_CONFIG', `LOCALDOMAIN', `RES_OPTIONS', `HOSTAL
- IASES', `NLSPATH', `PATH_LOCALE', `TERMINFO', `TER
- MINFO_DIRS' and `TERMPATH' variables as they too can pose
- a threat. If the `TERMCAP' variable is set and is a path
- name, it too is ignored. Additionally, if the `LC_*' or
- `LANGUAGE' variables contain the `/' or `%' characters,
- they are ignored. If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo has been compiled with SecurID
+ To combat this the LD_*, _RLD_*, SHLIB_PATH (HP-UX only),
+ and LIBPATH (AIX only) environment variables are removed
+ from the environment passed on to all commands executed.
+ s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will also remove the IFS, ENV, BASH_ENV, KRB_CONF,
+ KRBCONFDIR, KRBTKFILE, KRB5_CONFIG, LOCALDOMAIN,
+ RES_OPTIONS, HOSTALIASES, NLSPATH, PATH_LOCALE, TERMINFO,
+ TERMINFO_DIRS and TERMPATH variables as they too can pose
-December 29, 2000 1.6.4 3
+December 14, 2001 1.6.4 3
sudo(1m) MAINTENANCE COMMANDS sudo(1m)
- support, the `VAR_ACE', `USR_ACE' and `DLC_ACE' variables
- are cleared as well.
+ a threat. If the TERMCAP variable is set and is a path
+ name, it too is ignored. Additionally, if the LC_* or
+ LANGUAGE variables contain the / or % characters, they are
+ ignored. If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo has been compiled with SecurID support,
+ the VAR_ACE, USR_ACE and DLC_ACE variables are cleared as
+ well. The list of environment variables that s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo clears
+ is contained in the output of sudo -V when run as root.
To prevent command spoofing, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo checks "." and "" (both
denoting current directory) last when searching for a com
mand in the user's PATH (if one or both are in the PATH).
- Note, however, that the actual `PATH' environment variable
+ Note, however, that the actual PATH environment variable
is _\bn_\bo_\bt modified and is passed unchanged to the program
that s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo executes.
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will not honor timestamps set far in the future.
Timestamps with a date greater than current_time + 2 *
- `TIMEOUT' will be ignored and sudo will log and complain.
+ 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 date on systems that allow users to
give away files.
-E\bE\bE\bEX\bX\bX\bXA\bA\bA\bAM\bM\bM\bMP\bP\bP\bPL\bL\bL\bLE\bE\bE\bES\bS\bS\bS
- Note: the following examples assume suitable _\bs_\bu_\bd_\bo_\be_\br_\bs(4)
- entries.
+ Please note that s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will only log the command it explic
+ itly runs. If a user runs a command such as sudo su or
+ sudo sh, subsequent commands run from that shell will _\bn_\bo_\bt
+ be logged, nor will s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo's access control affect them.
+ The same is true for commands that offer shell escapes
+ (including most editors). Because of this, care must be
+ taken when giving users access to commands via s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to
- To get a file listing of an unreadable directory:
- % sudo ls /usr/local/protected
- To list the home directory of user yazza on a machine
- where the filesystem holding ~yazza is not exported as
- root:
+December 14, 2001 1.6.4 4
-December 29, 2000 1.6.4 4
+sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ verify that the command does not inadvertantly give the
+ user an effective root shell.
+E\bE\bE\bEX\bX\bX\bXA\bA\bA\bAM\bM\bM\bMP\bP\bP\bPL\bL\bL\bLE\bE\bE\bES\bS\bS\bS
+ Note: the following examples assume suitable _\bs_\bu_\bd_\bo_\be_\br_\bs(4)
+ entries.
-sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+ To get a file listing of an unreadable directory:
+
+ % sudo ls /usr/local/protected
+ To list the home directory of user yazza on a machine
+ where the filesystem holding ~yazza is not exported as
+ root:
% sudo -u yazza ls ~yazza
To make a usage listing of the directories in the /home
partition. Note that this runs the commands in a sub-
- shell to make the `cd' and file redirection work.
+ shell to make the cd and file redirection work.
% sudo sh -c "cd /home ; du -s * | sort -rn > USAGE"
/var/run/sudo Directory containing timestamps
+
+
+December 14, 2001 1.6.4 5
+
+
+
+
+
+sudo(1m) MAINTENANCE COMMANDS sudo(1m)
+
+
A\bA\bA\bAU\bU\bU\bUT\bT\bT\bTH\bH\bH\bHO\bO\bO\bOR\bR\bR\bRS\bS\bS\bS
Many people have worked on s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo over the years; this ver
sion consists of code written primarily by:
If you feel you have found a bug in sudo, please submit a
bug report at http://www.courtesan.com/sudo/bugs/
-
-
-December 29, 2000 1.6.4 5
-
-
-
-
-
-sudo(1m) MAINTENANCE COMMANDS sudo(1m)
-
-
D\bD\bD\bDI\bI\bI\bIS\bS\bS\bSC\bC\bC\bCL\bL\bL\bLA\bA\bA\bAI\bI\bI\bIM\bM\bM\bME\bE\bE\bER\bR\bR\bR
S\bS\bS\bSu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is provided ``AS IS'' and any express or implied war
ranties, including, but not limited to, the implied war
shell if that user has access to commands allowing shell
escapes.
- If users have sudo `ALL' there is nothing to prevent them
+ If users have sudo ALL there is nothing to prevent them
from creating their own program that gives them a root
shell regardless of any '!' elements in the user specifi
cation.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-December 29, 2000 1.6.4 6
+December 14, 2001 1.6.4 6
sudoers - list of which users may execute what
D\bD\bD\bDE\bE\bE\bES\bS\bS\bSC\bC\bC\bCR\bR\bR\bRI\bI\bI\bIP\bP\bP\bPT\bT\bT\bTI\bI\bI\bIO\bO\bO\bON\bN\bN\bN
- The _\bs_\bu_\bd_\bo_\be_\br_\bs file is composed two types of entries: aliases
- (basically variables) and user specifications (which spec
- ify who may run what). The grammar of _\bs_\bu_\bd_\bo_\be_\br_\bs will be
- described below in Extended Backus-Naur Form (EBNF).
- Don't despair if you don't know what EBNF is, it is fairly
- simple and the definitions below are annotated.
+ The _\bs_\bu_\bd_\bo_\be_\br_\bs file is composed of two types of entries:
+ aliases (basically variables) and user specifications
+ (which specify who may run what). The grammar of _\bs_\bu_\bd_\bo_\be_\br_\bs
+ will be described below in Extended Backus-Naur Form
+ (EBNF). Don't despair if you don't know what EBNF is; it
+ is fairly simple, and the definitions below are annotated.
Q\bQ\bQ\bQu\bu\bu\bui\bi\bi\bic\bc\bc\bck\bk\bk\bk g\bg\bg\bgu\bu\bu\bui\bi\bi\bid\bd\bd\bde\be\be\be t\bt\bt\bto\bo\bo\bo E\bE\bE\bEB\bB\bB\bBN\bN\bN\bNF\bF\bF\bF
EBNF is a concise and exact way of describing the grammar
of a language. Each EBNF definition is made up of _\bp_\br_\bo_\bd_\bu_\bc_\b
- _\bt_\bi_\bo_\bn _\br_\bu_\bl_\be_\bs. Eg.
+ _\bt_\bi_\bo_\bn _\br_\bu_\bl_\be_\bs. E.g.,
symbol ::= definition | alternate1 | alternate2 ...
ular expressions. Do not, however, confuse them with
"wildcard" characters, which have different meanings.
- `?' Means that the preceding symbol (or group of sym
+ ? Means that the preceding symbol (or group of sym
bols) is optional. That is, it may appear once or
not at all.
- `*' Means that the preceding symbol (or group of sym
+ * Means that the preceding symbol (or group of sym
bols) may appear zero or more times.
- `+' Means that the preceding symbol (or group of sym
+ + Means that the preceding symbol (or group of sym
bols) may appear one or more times.
Parentheses may be used to group symbols together. For
A\bA\bA\bAl\bl\bl\bli\bi\bi\bia\ba\ba\bas\bs\bs\bse\be\be\bes\bs\bs\bs
- There are four kinds of aliases: the `User_Alias',
- `Runas_Alias', `Host_Alias' and `Cmnd_Alias'.
+ There are four kinds of aliases: User_Alias, Runas_Alias,
+ Host_Alias and Cmnd_Alias.
- Alias ::= 'User_Alias' = User_Alias (':' User_Alias)* |
- 'Runas_Alias' = Runas_Alias (':' Runas_Alias)* |
- 'Host_Alias' = Host_Alias (':' Host_Alias)* |
- 'Cmnd_Alias' = Cmnd_Alias (':' Cmnd_Alias)*
+ Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |
+ 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |
+ 'Host_Alias' Host_Alias (':' Host_Alias)* |
+ 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*
User_Alias ::= NAME '=' User_List
-December 29, 2000 1.6.4 1
+December 13, 2001 1.6.4 1
Alias_Type NAME = item1, item2, ...
- where _\bA_\bl_\bi_\ba_\bs_\b__\bT_\by_\bp_\be is one of `User_Alias', `Runas_Alias',
- `Host_Alias', or `Cmnd_Alias'. A `NAME' is a string of
- upper case letters, numbers, and the underscore characters
- ('_'). A `NAME' m\bm\bm\bmu\bu\bu\bus\bs\bs\bst\bt\bt\bt start with an upper case letter. It
- is possible to put several alias definitions of the same
- type on a single line, joined by a colon (':'). Eg.
+ where _\bA_\bl_\bi_\ba_\bs_\b__\bT_\by_\bp_\be is one of User_Alias, Runas_Alias,
+ Host_Alias, or Cmnd_Alias. A NAME is a string of upper
+ case letters, numbers, and the underscore characters
+ ('_'). A NAME m\bm\bm\bmu\bu\bu\bus\bs\bs\bst\bt\bt\bt start with an uppercase letter. It is
+ possible to put several alias definitions of the same type
+ on a single line, joined by a colon (':'). E.g.,
Alias_Type NAME = item1, item2, item3 : NAME = item4, item5
'!'* '+'netgroup |
'!'* User_Alias
- A `User_List' is made up of one or more usernames, uids
+ A User_List is made up of one or more usernames, uids
(prefixed with '#'), System groups (prefixed with '%'),
netgroups (prefixed with '+') and other aliases. Each
list item may be prefixed with one or more '!' operators.
- An odd number of '!' operators negates the value of the
+ An odd number of '!' operators negate the value of the
item; an even number just cancel each other out.
Runas_List ::= Runas_User |
'!'* +netgroup |
'!'* Runas_Alias
- Likewise, a `Runas_List' has the same possible elements as
- a `User_List', except that it can include a `Runas_Alias',
- instead of a `User_Alias'.
+ Likewise, a Runas_List has the same possible elements as a
+ User_List, except that it can include a Runas_Alias,
+ instead of a User_Alias.
Host_List ::= Host |
Host ',' Host_List
-December 29, 2000 1.6.4 2
+December 13, 2001 1.6.4 2
'!'* '+'netgroup |
'!'* Host_Alias
- A `Host_List' is made up of one or more hostnames, IP
+ A Host_List is made up of one or more hostnames, IP
addresses, network numbers, netgroups (prefixed with '+')
and other aliases. Again, the value of an item may be
negated with the '!' operator. If you do not specify a
netmask with a network number, the netmask of the host's
ethernet _\bi_\bn_\bt_\be_\br_\bf_\ba_\bc_\be(s) will be used when matching. The
netmask may be specified either in dotted quad notation
- (eg. 255.255.255.0) or CIDR notation (number of bits, eg.
- 24). A hostname may include shell-style wildcards (see
- `Wildcards' section below), but unless the `hostname' com
- mand on your machine returns the fully qualified hostname,
- you'll need to use the _\bf_\bq_\bd_\bn option for wildcards to be
- useful.
+ (e.g. 255.255.255.0) or CIDR notation (number of bits,
+ e.g. 24). A hostname may include shell-style wildcards
+ (see `Wildcards' section below), but unless the hostname
+ command on your machine returns the fully qualified host
+ name, you'll need to use the _\bf_\bq_\bd_\bn option for wildcards to
+ be useful.
Cmnd_List ::= Cmnd |
Cmnd ',' Cmnd_List
'!'* directory |
'!'* Cmnd_Alias
- A `Cmnd_List' is a list of one or more commandnames,
- directories, and other aliases. A commandname is a fully
- qualified filename which may include shell-style wildcards
+ A Cmnd_List is a list of one or more commandnames, direc
+ tories, and other aliases. A commandname is a fully qual
+ ified filename which may include shell-style wildcards
(see `Wildcards' section below). A simple filename allows
the user to run the command with any arguments he/she
- wishes. However, you may also command line arguments
- (including wildcards). Alternately, you can specify `""'
- to indicate that the command may only be run w\bw\bw\bwi\bi\bi\bit\bt\bt\bth\bh\bh\bho\bo\bo\bou\bu\bu\but\bt\bt\bt com
- mand line arguments. A directory is a fully qualified
+ wishes. However, you may also specify command line argu
+ ments (including wildcards). Alternately, you can specify
+ "" to indicate that the command may only be run w\bw\bw\bwi\bi\bi\bit\bt\bt\bth\bh\bh\bho\bo\bo\bou\bu\bu\but\bt\bt\bt
+ command line arguments. A directory is a fully qualified
pathname ending in a '/'. When you specify a directory in
- a `Cmnd_List', the user will be able to run any file
- within that directory (but not in any subdirectories
- therein).
+ a Cmnd_List, the user will be able to run any file within
+ that directory (but not in any subdirectories therein).
- If a `Cmnd' has associated command line arguments, then
- the arguments in the `Cmnd' must match exactly those given
- by the user on the command line (or match the wildcards if
+ If a Cmnd has associated command line arguments, then the
+ arguments in the Cmnd must match exactly those given by
+ the user on the command line (or match the wildcards if
there are any). Note that the following characters must
be escaped with a '\' if they are used in command argu
ments: ',', ':', '=', '\'.
-December 29, 2000 1.6.4 3
+
+December 13, 2001 1.6.4 3
D\bD\bD\bDe\be\be\bef\bf\bf\bfa\ba\ba\bau\bu\bu\bul\bl\bl\blt\bt\bt\bts\bs\bs\bs
Certain configuration options may be changed from their
- default values at runtime via one or more `Default_Entry'
+ default values at runtime via one or more Default_Entry
lines. These may affect all users on any host, all users
on a specific host, or just a specific user. When multi
ple entries match, they are applied in order. Where there
Default_Entry ::= Default_Type Parameter_List
Parameter ::= Parameter '=' Value ||
+ Parameter '+=' Value ||
+ Parameter '-=' Value ||
'!'* Parameter ||
- Parameters may be f\bf\bf\bfl\bl\bl\bla\ba\ba\bag\bg\bg\bgs\bs\bs\bs, i\bi\bi\bin\bn\bn\bnt\bt\bt\bte\be\be\beg\bg\bg\bge\be\be\ber\br\br\br values, or s\bs\bs\bst\bt\bt\btr\br\br\bri\bi\bi\bin\bn\bn\bng\bg\bg\bgs\bs\bs\bs.
- Flags are implicitly boolean and can be turned off via the
- '!' operator. Some integer and string parameters may also
- be used in a boolean context to disable them. Values may
- be enclosed in double quotes (`"') when they contain mul
- tiple words. Special characters may be escaped with a
- backslash (`\').
+ Parameters may be f\bf\bf\bfl\bl\bl\bla\ba\ba\bag\bg\bg\bgs\bs\bs\bs, i\bi\bi\bin\bn\bn\bnt\bt\bt\bte\be\be\beg\bg\bg\bge\be\be\ber\br\br\br values, s\bs\bs\bst\bt\bt\btr\br\br\bri\bi\bi\bin\bn\bn\bng\bg\bg\bgs\bs\bs\bs, or
+ l\bl\bl\bli\bi\bi\bis\bs\bs\bst\bt\bt\bts\bs\bs\bs. Flags are implicitly boolean and can be turned off
+ via the '!' operator. Some integer, string and list
+ parameters may also be used in a boolean context to dis
+ able them. Values may be enclosed in double quotes (")
+ when they contain multiple words. Special characters may
+ be escaped with a backslash (\).
+
+ Lists have two additional assignment operators, += and -=.
+ These operators are used to add to and delete from a list
+ respectively. It is not an error to use the -= operator
+ to remove an element that does not exist in a list.
F\bF\bF\bFl\bl\bl\bla\ba\ba\bag\bg\bg\bgs\bs\bs\bs:
more convenient. This flag is _\bo_\bf_\bf by default.
ignore_dot If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will ignore '.' or '' (current
- dir) in the `PATH' environment variable; the
- `PATH' itself is not modified. This flag is
- _\bo_\bf_\bf by default.
+ dir) in the PATH environment variable; the
+ PATH itself is not modified. This flag is _\bo_\bf_\bf
+ by default.
mail_always Send mail to the _\bm_\ba_\bi_\bl_\bt_\bo user every time a
users runs s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo. This flag is _\bo_\bf_\bf by default.
- mail_no_user
- If set, mail will be sent to the _\bm_\ba_\bi_\bl_\bt_\bo user
- if the invoking user is not in the _\bs_\bu_\bd_\bo_\be_\br_\bs
- file. This flag is _\bo_\bn by default.
-
- mail_no_host
- If set, mail will be sent to the _\bm_\ba_\bi_\bl_\bt_\bo user
- if the invoking user exists in the _\bs_\bu_\bd_\bo_\be_\br_\bs
- file, but is not allowed to run commands on
+ mail_badpass
+ Send mail to the _\bm_\ba_\bi_\bl_\bt_\bo user if the user
-December 29, 2000 1.6.4 4
+December 13, 2001 1.6.4 4
sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ running sudo does not enter the correct pass
+ word. This flag is _\bo_\bf_\bf by default.
+
+ mail_no_user
+ If set, mail will be sent to the _\bm_\ba_\bi_\bl_\bt_\bo user
+ if the invoking user is not in the _\bs_\bu_\bd_\bo_\be_\br_\bs
+ file. This flag is _\bo_\bn by default.
+
+ mail_no_host
+ If set, mail will be sent to the _\bm_\ba_\bi_\bl_\bt_\bo user
+ if the invoking user exists in the _\bs_\bu_\bd_\bo_\be_\br_\bs
+ file, but is not allowed to run commands on
the current host. This flag is _\bo_\bf_\bf by
default.
If set, users must authenticate themselves via
a password (or other means of authentication)
before they may run commands. This default
- may be overridden via the `PASSWD' and
- `NOPASSWD' tags. This flag is _\bo_\bn by default.
+ may be overridden via the PASSWD and NOPASSWD
+ tags. This flag is _\bo_\bn by default.
root_sudo If set, root is allowed to run s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo too. Dis
abling this prevents users from "chaining"
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo commands to get a root shell by doing
- something like `"sudo sudo /bin/sh"'. This
- flag is _\bo_\bn by default.
+ something like "sudo sudo /bin/sh". This flag
+ is _\bo_\bn by default.
log_host If set, the hostname will be logged in the
(non-syslog) s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo log file. This flag is _\bo_\bf_\bf
the (non-syslog) s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo log file. This flag is
_\bo_\bf_\bf by default.
- shell_noargs
- If set and s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is invoked with no arguments
- it acts as if the -\b-\b-\b-s\bs\bs\bs flag had been given.
- That is, it runs a shell as root (the shell is
- determined by the `SHELL' environment variable
- if it is set, falling back on the shell listed
- in the invoking user's /etc/passwd entry if
- not). This flag is _\bo_\bf_\bf by default.
-
- set_home If set and s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is invoked with the -\b-\b-\b-s\bs\bs\bs flag
- the `HOME' environment variable will be set to
-
-December 29, 2000 1.6.4 5
+December 13, 2001 1.6.4 5
sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ shell_noargs
+ If set and s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is invoked with no arguments
+ it acts as if the -\b-\b-\b-s\bs\bs\bs flag had been given.
+ That is, it runs a shell as root (the shell is
+ determined by the SHELL environment variable
+ if it is set, falling back on the shell listed
+ in the invoking user's /etc/passwd entry if
+ not). This flag is _\bo_\bf_\bf by default.
+
+ set_home If set and s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is invoked with the -\b-\b-\b-s\bs\bs\bs flag
+ the HOME environment variable will be set to
the home directory of the target user (which
is root unless the -\b-\b-\b-u\bu\bu\bu option is used). This
effectively makes the -\b-\b-\b-s\bs\bs\bs flag imply -\b-\b-\b-H\bH\bH\bH. This
flag is _\bo_\bf_\bf by default.
always_set_home
- If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will set the `HOME' environment
+ If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will set the HOME environment
variable to the home directory of the target
user (which is root unless the -\b-\b-\b-u\bu\bu\bu option is
used). This effectively means that the -\b-\b-\b-H\bH\bH\bH
default.
path_info Normally, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will tell the user when a com
- mand could not be found in their `PATH' envi
- ronment variable. Some sites may wish to dis
- able this as it could be used to gather infor
- mation on the location of executables that the
- normal user does not have access to. The dis
- advantage is that if the executable is simply
- not in the user's `PATH', s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will tell the
- user that they are not allowed to run it,
- which can be confusing. This flag is off by
- default.
+ mand could not be found in their PATH environ
+ ment variable. Some sites may wish to disable
+ this as it could be used to gather information
+ on the location of executables that the normal
+ user does not have access to. The disadvan
+ tage is that if the executable is simply not
+ in the user's PATH, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will tell the user
+ that they are not allowed to run it, which can
+ be confusing. This flag is off by default.
fqdn Set this flag if you want to put fully quali
- fied hostnames in the _\bs_\bu_\bd_\bo_\be_\br_\bs file. Ie:
+ fied hostnames in the _\bs_\bu_\bd_\bo_\be_\br_\bs file. I.e.:
instead of myhost you would use myhost.mydo
main.edu. You may still use the short form if
you wish (and even mix the two). Beware that
not plugged into the network). Also note that
you must use the host's official name as DNS
knows it. That is, you may not use a host
- alias (`CNAME' entry) due to performance
- issues and the fact that there is no way to
- get all aliases from DNS. If your machine's
- hostname (as returned by the `hostname' com
- mand) is already fully qualified you shouldn't
- need to set _\bf_\bq_\bd_\bn. This flag is _\bo_\bf_\bf by
- default.
+ alias (CNAME entry) due to performance issues
+ and the fact that there is no way to get all
+ aliases from DNS. If your machine's hostname
+ (as returned by the hostname command) is
+ already fully qualified you shouldn't need to
+ set _\bf_\bq_\bd_\bn. This flag is _\bo_\bf_\bf by default.
- insults If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will insult users when they enter
- an incorrect password. This flag is _\bo_\bf_\bf by
- default.
- requiretty If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will only run when the user is
- logged in to a real tty. This will disallow
- things like `"rsh somehost sudo ls"' since
- _\br_\bs_\bh(1) does not allocate a tty. Because it is
- not possible to turn of echo when there is no
- tty present, some sites may with to set this
-December 29, 2000 1.6.4 6
+December 13, 2001 1.6.4 6
sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ insults If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will insult users when they enter
+ an incorrect password. This flag is _\bo_\bf_\bf by
+ default.
+
+ requiretty If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will only run when the user is
+ logged in to a real tty. This will disallow
+ things like "rsh somehost sudo ls" since
+ _\br_\bs_\bh(1) does not allocate a tty. Because it is
+ not possible to turn of echo when there is no
+ tty present, some sites may with to set this
flag to prevent a user from entering a visible
password. This flag is _\bo_\bf_\bf by default.
allows the user to run any arbitrary command
as root without logging. A safer alternative
is to place a colon-separated list of editors
- in the `editor' variable. v\bv\bv\bvi\bi\bi\bis\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will then
- only use the EDITOR or VISUAL if they match a
- value specified in `editor'. This flag is
- `off' by default.
+ in the editor variable. v\bv\bv\bvi\bi\bi\bis\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will then only
+ use the EDITOR or VISUAL if they match a value
+ specified in editor. This flag is off by
+ default.
rootpw If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will prompt for the root password
instead of the password of the invoking user.
runaspw If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will prompt for the password of
the user defined by the _\br_\bu_\bn_\ba_\bs_\b__\bd_\be_\bf_\ba_\bu_\bl_\bt option
- (defaults to `root') instead of the password
- of the invoking user. This flag is _\bo_\bf_\bf by
+ (defaults to root) instead of the password of
+ the invoking user. This flag is _\bo_\bf_\bf by
default.
targetpw If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will prompt for the password of
the user specified by the -\b-\b-\b-u\bu\bu\bu flag (defaults to
- `root') instead of the password of the invok
- ing user. This flag is _\bo_\bf_\bf by default.
-
- set_logname Normally, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will set the `LOGNAME' and
- `USER' environment variables to the name of
- the target user (usually root unless the -\b-\b-\b-u\bu\bu\bu
- flag is given). However, since some programs
- (including the RCS revision control system)
- use `LOGNAME' to determine the real identity
- of the user, it may be desirable to change
- this behavior. This can be done by negating
- the set_logname option.
+ root) instead of the password of the invoking
+ user. This flag is _\bo_\bf_\bf by default.
+
+ set_logname Normally, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will set the LOGNAME and USER
+ environment variables to the name of the tar
+ get user (usually root unless the -\b-\b-\b-u\bu\bu\bu flag is
+ given). However, since some programs (includ
+ ing the RCS revision control system) use LOG
+ NAME to determine the real identity of the
+ user, it may be desirable to change this
+ behavior. This can be done by negating the
+ set_logname option.
stay_setuid Normally, when s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo executes a command the
real and effective UIDs are set to the target
user (root by default). This option changes
that behavior such that the real UID is left
- as the invoking user's UID. In other words,
- this makes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo act as a setuid wrapper. This
- can be useful on systems that disable some
- potentially dangerous functionality when a
- program is run setuid.
-
- env_reset If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will reset the environment to
- only contain the following variables: `HOME',
- `SHELL', `LOGNAME', and `USER' (in addition to
- the `SUDO_*' variables). The `PATH' and
-December 29, 2000 1.6.4 7
+December 13, 2001 1.6.4 7
sudoers(4) MAINTENANCE COMMANDS sudoers(4)
- `TERM' environment variables are preserved
- unaltered. Other specific variables may be
- preserved with the i<env_keep> option.
+ as the invoking user's UID. In other words,
+ this makes s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo act as a setuid wrapper. This
+ can be useful on systems that disable some
+ potentially dangerous functionality when a
+ program is run setuid.
+
+ env_reset If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will reset the environment to
+ only contain the following variables: HOME,
+ LOGNAME, PATH, SHELL, TERM, and USER (in addi
+ tion to the SUDO_* variables). Of these, only
+ TERM is copied unaltered from the old environ
+ ment. The other variables are set to default
+ values (possibly modified by the value of the
+ _\bs_\be_\bt_\b__\bl_\bo_\bg_\bn_\ba_\bm_\be option). If s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo was compiled
+ with the SECURE_PATH option, its value will be
+ used for the PATH environment variable. Other
+ variables may be preserved with the
+ i<env_keep> option.
use_loginclass
If set, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will apply the defaults specified
passwd_tries
The number of tries a user gets to enter
his/her password before s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo logs the failure
- and exits. The default is `3'.
+ and exits. The default is 3.
I\bI\bI\bIn\bn\bn\bnt\bt\bt\bte\be\be\beg\bg\bg\bge\be\be\ber\br\br\brs\bs\bs\bs t\bt\bt\bth\bh\bh\bha\ba\ba\bat\bt\bt\bt c\bc\bc\bca\ba\ba\ban\bn\bn\bn b\bb\bb\bbe\be\be\be u\bu\bu\bus\bs\bs\bse\be\be\bed\bd\bd\bd i\bi\bi\bin\bn\bn\bn a\ba\ba\ba b\bb\bb\bbo\bo\bo\boo\bo\bo\bol\bl\bl\ble\be\be\bea\ba\ba\ban\bn\bn\bn c\bc\bc\bco\bo\bo\bon\bn\bn\bnt\bt\bt\bte\be\be\bex\bx\bx\bxt\bt\bt\bt:
log. This value is used to decide when to
wrap lines for nicer log files. This has no
effect on the syslog log file, only the file
- log. The default is `80' (use 0 or negate the
+ log. The default is 80 (use 0 or negate the
option to disable word wrap).
timestamp_timeout
Number of minutes that can elapse before s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo
will ask for a passwd again. The default is
- `5', set this to `0' to always prompt for a
- password.
+ 5. Set this to 0 to always prompt for a pass
+ word. If set to a value less than 0 the
+ user's timestamp will never expire. This can
+ be used to allow users to create or delete
+ their own timestamps via sudo -v and sudo -k
+ respectively.
passwd_timeout
Number of minutes before the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo password
- prompt times out. The default is `5', set
- this to `0' for no password timeout.
- umask Umask to use when running the command. Negate
- this option or set it to 0777 to preserve the
- user's umask. The default is `0022'.
- S\bS\bS\bSt\bt\bt\btr\br\br\bri\bi\bi\bin\bn\bn\bng\bg\bg\bgs\bs\bs\bs:
- mailsub Subject of the mail sent to the _\bm_\ba_\bi_\bl_\bt_\bo user.
- The escape `%h' will expand to the hostname of
- the machine. Default is `*** SECURITY infor
- mation for %h ***'.
+December 13, 2001 1.6.4 8
- badpass_message
- Message that is displayed if a user enters an
- incorrect password. The default is `Sorry,
- try again.' unless insults are enabled.
-December 29, 2000 1.6.4 8
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ prompt times out. The default is 5, set this
+ to 0 for no password timeout.
+ umask Umask to use when running the command. Negate
+ this option or set it to 0777 to preserve the
+ user's umask. The default is 0022.
+ S\bS\bS\bSt\bt\bt\btr\br\br\bri\bi\bi\bin\bn\bn\bng\bg\bg\bgs\bs\bs\bs:
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ mailsub Subject of the mail sent to the _\bm_\ba_\bi_\bl_\bt_\bo user.
+ The escape %h will expand to the hostname of
+ the machine. Default is *** SECURITY informa
+ tion for %h ***.
+ badpass_message
+ Message that is displayed if a user enters an
+ incorrect password. The default is Sorry, try
+ again. unless insults are enabled.
timestampdir
The directory in which s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo stores its times
passprompt The default prompt to use when asking for a
password; can be overridden via the -\b-\b-\b-p\bp\bp\bp option
- or the `SUDO_PROMPT' environment variable.
- Supports two escapes: "%u" expands to the
- user's login name and "%h" expands to the
- local hostname. The default value is `Pass
- word:'.
+ or the SUDO_PROMPT environment variable. Sup
+ ports two escapes: "%u" expands to the user's
+ login name and "%h" expands to the local host
+ name. The default value is Password:.
runas_default
The default user to run commands as if the -\b-\b-\b-u\bu\bu\bu
flag is not specified on the command line.
- This defaults to `root'.
+ This defaults to root.
syslog_goodpri
Syslog priority to use when user authenticates
- successfully. Defaults to `notice'.
+ successfully. Defaults to notice.
syslog_badpri
Syslog priority to use when user authenticates
- unsuccessfully. Defaults to `alert'.
-
- env_keep A double-quoted, space-separated list of envi
- ronment variables to be preserved in the
- user's environment. When used in conjuction
- with the _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt option, this allows fine
- control over the environment s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo-spawned pro
- cesses will get. If the _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt option is
- not used, _\be_\bn_\bv_\b__\bk_\be_\be_\bp can be used to make excep
- tions to the built in list of "dangerous"
- environment variables.
+ unsuccessfully. Defaults to alert.
editor A colon (':') separated list of editors
allowed to be used with v\bv\bv\bvi\bi\bi\bis\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo. v\bv\bv\bvi\bi\bi\bis\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo will
S\bS\bS\bSt\bt\bt\btr\br\br\bri\bi\bi\bin\bn\bn\bng\bg\bg\bgs\bs\bs\bs t\bt\bt\bth\bh\bh\bha\ba\ba\bat\bt\bt\bt c\bc\bc\bca\ba\ba\ban\bn\bn\bn b\bb\bb\bbe\be\be\be u\bu\bu\bus\bs\bs\bse\be\be\bed\bd\bd\bd i\bi\bi\bin\bn\bn\bn a\ba\ba\ba b\bb\bb\bbo\bo\bo\boo\bo\bo\bol\bl\bl\ble\be\be\bea\ba\ba\ban\bn\bn\bn c\bc\bc\bco\bo\bo\bon\bn\bn\bnt\bt\bt\bte\be\be\bex\bx\bx\bxt\bt\bt\bt:
- logfile Path to the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo log file (not the syslog log
- file). Setting a path turns on logging to a
- file, negating this option turns it off.
- syslog Syslog facility if syslog is being used for
- logging (negate to disable syslog logging).
- Defaults to `local2'.
+December 13, 2001 1.6.4 9
-December 29, 2000 1.6.4 9
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+ logfile Path to the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo log file (not the syslog log
+ file). Setting a path turns on logging to a
+ file; negating this option turns it off.
+ syslog Syslog facility if syslog is being used for
+ logging (negate to disable syslog logging).
+ Defaults to local2.
mailerpath Path to mail program used to send warning
mail. Defaults to the path to sendmail found
mailerflags Flags to use when invoking mailer. Defaults to
-\b-\b-\b-t\bt\bt\bt.
- mailto Address to send warning and erorr mail to.
+ mailto Address to send warning and error mail to.
The address should be enclosed in double
- quotes (`"') to protect against sudo inter
- preting the `@' sign. Defaults to `root'.
+ quotes (") to protect against sudo interpret
+ ing the @ sign. Defaults to root.
exempt_group
Users in this group are exempt from password
and PATH requirements. This is not set by
default.
- secure_path Path used for every command run from s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo. If
- you don't trust the people running s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo to
- have a sane `PATH' environment variable you
- may want to use this. Another use is if you
- want to have the "root path" be separate from
- the "user path." This is not set by default.
-
verifypw This option controls when a password will be
required when a user runs s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo with the -\b-\b-\b-v\bv\bv\bv
flag. It has the following possible values:
-
-December 29, 2000 1.6.4 10
+December 13, 2001 1.6.4 10
The default value is `any'.
+ L\bL\bL\bLi\bi\bi\bis\bs\bs\bst\bt\bt\bts\bs\bs\bs t\bt\bt\bth\bh\bh\bha\ba\ba\bat\bt\bt\bt c\bc\bc\bca\ba\ba\ban\bn\bn\bn b\bb\bb\bbe\be\be\be u\bu\bu\bus\bs\bs\bse\be\be\bed\bd\bd\bd i\bi\bi\bin\bn\bn\bn a\ba\ba\ba b\bb\bb\bbo\bo\bo\boo\bo\bo\bol\bl\bl\ble\be\be\bea\ba\ba\ban\bn\bn\bn c\bc\bc\bco\bo\bo\bon\bn\bn\bnt\bt\bt\bte\be\be\bex\bx\bx\bxt\bt\bt\bt:
+
+ env_check A double-quoted, space-separated list of envi
+ ronment variables to be removed from the
+ user's environment if the variable's value
+ contains % or / characters. This can be used
+ to guard against printf-style format vulnera
+ bilties in poorly-written programs. The list
+ can be replaced, added to, deleted from, or
+ disabled by using the =, +=, -=, and <!> oper
+ ators respectively. The default list of envi
+ ronment variable to check is printed when s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo
+ is run by root with the _\b-_\bV option.
+
+ env_delete A double-quoted, space-separated list of envi
+ ronment variables to be removed from the
+ user's environment. The list can be replaced,
+ added to, deleted from, or disabled by using
+ the =, +=, -=, and <!> operators respectively.
+ The default list of environment variable to
+ remove is printed when s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo is run by root
+ with the _\b-_\bV option.
+
+ env_keep A double-quoted, space-separated list of envi
+ ronment variables to be preserved in the
+ user's environment when the _\be_\bn_\bv_\b__\br_\be_\bs_\be_\bt option
+ is in effect. This allows fine-grained con
+ trol over the environment s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo-spawned pro
+ cesses will get. The list can be replaced,
+ added to, deleted from, or disabled by using
+ the =, +=, -=, and <!> operators respectively.
+ This list has no default members.
+
When logging via _\bs_\by_\bs_\bl_\bo_\bg(3), s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo accepts the following
values for the syslog facility (the value of the s\bs\bs\bsy\by\by\bys\bs\bs\bsl\bl\bl\blo\bo\bo\bog\bg\bg\bg
Parameter): a\ba\ba\bau\bu\bu\but\bt\bt\bth\bh\bh\bhp\bp\bp\bpr\br\br\bri\bi\bi\biv\bv\bv\bv (if your OS supports it), a\ba\ba\bau\bu\bu\but\bt\bt\bth\bh\bh\bh, d\bd\bd\bda\ba\ba\bae\be\be\be\b\b\b
supported: a\ba\ba\bal\bl\bl\ble\be\be\ber\br\br\brt\bt\bt\bt, c\bc\bc\bcr\br\br\bri\bi\bi\bit\bt\bt\bt, d\bd\bd\bde\be\be\beb\bb\bb\bbu\bu\bu\bug\bg\bg\bg, e\be\be\bem\bm\bm\bme\be\be\ber\br\br\brg\bg\bg\bg, e\be\be\ber\br\br\brr\br\br\br, i\bi\bi\bin\bn\bn\bnf\bf\bf\bfo\bo\bo\bo, n\bn\bn\bno\bo\bo\bot\bt\bt\bti\bi\bi\bic\bc\bc\bce\be\be\be,
and w\bw\bw\bwa\ba\ba\bar\br\br\brn\bn\bn\bni\bi\bi\bin\bn\bn\bng\bg\bg\bg.
+
+
+
+December 13, 2001 1.6.4 11
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
U\bU\bU\bUs\bs\bs\bse\be\be\ber\br\br\br S\bS\bS\bSp\bp\bp\bpe\be\be\bec\bc\bc\bci\bi\bi\bif\bf\bf\bfi\bi\bi\bic\bc\bc\bca\ba\ba\bat\bt\bt\bti\bi\bi\bio\bo\bo\bon\bn\bn\bn
- User_Spec ::= User_list Host_List '=' User_List Cmnd_Spec_List \
+ User_Spec ::= User_list Host_List '=' Cmnd_Spec_List \
(':' User_Spec)*
Cmnd_Spec_List ::= Cmnd_Spec |
A u\bu\bu\bus\bs\bs\bse\be\be\ber\br\br\br s\bs\bs\bsp\bp\bp\bpe\be\be\bec\bc\bc\bci\bi\bi\bif\bf\bf\bfi\bi\bi\bic\bc\bc\bca\ba\ba\bat\bt\bt\bti\bi\bi\bio\bo\bo\bon\bn\bn\bn determines which commands a user may
run (and as what user) on specified hosts. By default,
- commands are run as r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt but this can be changed on a per-
- command basis.
+ commands are run as r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt, but this can be changed on a
+ per-command basis.
Let's break that down into its constituent parts:
R\bR\bR\bRu\bu\bu\bun\bn\bn\bna\ba\ba\bas\bs\bs\bs_\b_\b_\b_S\bS\bS\bSp\bp\bp\bpe\be\be\bec\bc\bc\bc
- A `Runas_Spec' is simply a `Runas_List' (as defined above)
+ A Runas_Spec is simply a Runas_List (as defined above)
enclosed in a set of parentheses. If you do not specify a
- `Runas_Spec' in the user specification, a default
- `Runas_Spec' of r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt will be used. A `Runas_Spec' sets
- the default for commands that follow it. What this means
- is that for the entry:
+ Runas_Spec in the user specification, a default Runas_Spec
+ of r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt will be used. A Runas_Spec sets the default for
+ commands that follow it. What this means is that for the
+ entry:
dgb boulder = (operator) /bin/ls, /bin/kill, /usr/bin/who
The user d\bd\bd\bdg\bg\bg\bgb\bb\bb\bb may run _\b/_\bb_\bi_\bn_\b/_\bl_\bs, _\b/_\bb_\bi_\bn_\b/_\bk_\bi_\bl_\bl, and _\b/_\bu_\bs_\br_\b/_\bb_\bi_\bn_\b/_\bl_\bp_\br_\bm
- -- but only as o\bo\bo\bop\bp\bp\bpe\be\be\ber\br\br\bra\ba\ba\bat\bt\bt\bto\bo\bo\bor\br\br\br. Eg.
+ -- but only as o\bo\bo\bop\bp\bp\bpe\be\be\ber\br\br\bra\ba\ba\bat\bt\bt\bto\bo\bo\bor\br\br\br. E.g.,
+ sudo -u operator /bin/ls.
+ It is also possible to override a Runas_Spec later on in
+ an entry. If we modify the entry like so:
+ dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm
-December 29, 2000 1.6.4 11
+ Then user d\bd\bd\bdg\bg\bg\bgb\bb\bb\bb is now allowed to run _\b/_\bb_\bi_\bn_\b/_\bl_\bs as o\bo\bo\bop\bp\bp\bpe\be\be\ber\br\br\bra\ba\ba\bat\bt\bt\bto\bo\bo\bor\br\br\br,
+ but _\b/_\bb_\bi_\bn_\b/_\bk_\bi_\bl_\bl and _\b/_\bu_\bs_\br_\b/_\bb_\bi_\bn_\b/_\bl_\bp_\br_\bm as r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt.
+ N\bN\bN\bNO\bO\bO\bOP\bP\bP\bPA\bA\bA\bAS\bS\bS\bSS\bS\bS\bSW\bW\bW\bWD\bD\bD\bD a\ba\ba\ban\bn\bn\bnd\bd\bd\bd P\bP\bP\bPA\bA\bA\bAS\bS\bS\bSS\bS\bS\bSW\bW\bW\bWD\bD\bD\bD
+ By default, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo requires that a user authenticate him or
+ herself before running a command. This behavior can be
+ modified via the NOPASSWD tag. Like a Runas_Spec, the
+ NOPASSWD tag sets a default for the commands that follow
+ it in the Cmnd_Spec_List. Conversely, the PASSWD tag can
+ be used to reverse things. For example:
+ ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
- sudo -u operator /bin/ls.
+December 13, 2001 1.6.4 12
- It is also possible to override a `Runas_Spec' later on in
- an entry. If we modify the entry like so:
- dgb boulder = (operator) /bin/ls, (root) /bin/kill, /usr/bin/lprm
- Then user d\bd\bd\bdg\bg\bg\bgb\bb\bb\bb is now allowed to run _\b/_\bb_\bi_\bn_\b/_\bl_\bs as o\bo\bo\bop\bp\bp\bpe\be\be\ber\br\br\bra\ba\ba\bat\bt\bt\bto\bo\bo\bor\br\br\br,
- but _\b/_\bb_\bi_\bn_\b/_\bk_\bi_\bl_\bl and _\b/_\bu_\bs_\br_\b/_\bb_\bi_\bn_\b/_\bl_\bp_\br_\bm as r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt.
- N\bN\bN\bNO\bO\bO\bOP\bP\bP\bPA\bA\bA\bAS\bS\bS\bSS\bS\bS\bSW\bW\bW\bWD\bD\bD\bD a\ba\ba\ban\bn\bn\bnd\bd\bd\bd P\bP\bP\bPA\bA\bA\bAS\bS\bS\bSS\bS\bS\bSW\bW\bW\bWD\bD\bD\bD
- By default, s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo requires that a user authenticate him or
- herself before running a command. This behavior can be
- modified via the `NOPASSWD' tag. Like a `Runas_Spec', the
- `NOPASSWD' tag sets a default for the commands that follow
- it in the `Cmnd_Spec_List'. Conversely, the `PASSWD' tag
- can be used to reverse things. For example:
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
- ray rushmore = NOPASSWD: /bin/kill, /bin/ls, /usr/bin/lprm
would allow the user r\br\br\bra\ba\ba\bay\by\by\by to run _\b/_\bb_\bi_\bn_\b/_\bk_\bi_\bl_\bl, _\b/_\bb_\bi_\bn_\b/_\bl_\bs, and
_\b/_\bu_\bs_\br_\b/_\bb_\bi_\bn_\b/_\bl_\bp_\br_\bm as root on the machine rushmore as r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt
ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm
- Note however, that the `PASSWD' tag has no effect on users
+ Note, however, that the PASSWD tag has no effect on users
who are in the group specified by the exempt_group option.
- By default, if the `NOPASSWD' tag is applied to any of the
+ By default, if the NOPASSWD tag is applied to any of the
entries for a user on the current host, he or she will be
- able to run `sudo -l' without a password. Additionally, a
- user may only run `sudo -v' without a password if the
- `NOPASSWD' tag is present for all a user's entries that
- pertain to the current host. This behavior may be over
- ridden via the verifypw and listpw options.
+ able to run sudo -l without a password. Additionally, a
+ user may only run sudo -v without a password if the
+ NOPASSWD tag is present for all a user's entries that per
+ tain to the current host. This behavior may be overridden
+ via the verifypw and listpw options.
W\bW\bW\bWi\bi\bi\bil\bl\bl\bld\bd\bd\bdc\bc\bc\bca\ba\ba\bar\br\br\brd\bd\bd\bds\bs\bs\bs (\b(\b(\b(a\ba\ba\bak\bk\bk\bka\ba\ba\ba m\bm\bm\bme\be\be\bet\bt\bt\bta\ba\ba\ba c\bc\bc\bch\bh\bh\bha\ba\ba\bar\br\br\bra\ba\ba\bac\bc\bc\bct\bt\bt\bte\be\be\ber\br\br\brs\bs\bs\bs)\b)\b)\b):\b:\b:\b:
s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo allows shell-style _\bw_\bi_\bl_\bd_\bc_\ba_\br_\bd_\bs to be used in pathnames
as well as command line arguments in the _\bs_\bu_\bd_\bo_\be_\br_\bs file.
- Wildcard matching is done via the P\bP\bP\bPO\bO\bO\bOS\bS\bS\bSI\bI\bI\bIX\bX\bX\bX `fnmatch(3)' rou
+ Wildcard matching is done via the P\bP\bP\bPO\bO\bO\bOS\bS\bS\bSI\bI\bI\bIX\bX\bX\bX fnmatch(3) rou
tine. Note that these are _\bn_\bo_\bt regular expressions.
- `*' Matches any set of zero or more characters.
-
- `?' Matches any single character.
-
- `[...]' Matches any character in the specified range.
-
-
-
+ * Matches any set of zero or more characters.
+ ? Matches any single character.
-December 29, 2000 1.6.4 12
+ [...] Matches any character in the specified range.
+ [!...] Matches any character n\bn\bn\bno\bo\bo\bot\bt\bt\bt in the specified range.
-
-
-
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-
-
- `[!...]'
- Matches any character n\bn\bn\bno\bo\bo\bot\bt\bt\bt in the specified range.
-
- `\x' For any character "x", evaluates to "x". This is
+ \x For any character "x", evaluates to "x". This is
used to escape special characters such as: "*",
"?", "[", and "}".
/usr/bin/*
- match `/usr/bin/who' but not `/usr/bin/X11/xterm'.
+ match /usr/bin/who but not /usr/bin/X11/xterm.
E\bE\bE\bEx\bx\bx\bxc\bc\bc\bce\be\be\bep\bp\bp\bpt\bt\bt\bti\bi\bi\bio\bo\bo\bon\bn\bn\bns\bs\bs\bs t\bt\bt\bto\bo\bo\bo w\bw\bw\bwi\bi\bi\bil\bl\bl\bld\bd\bd\bdc\bc\bc\bca\ba\ba\bar\br\br\brd\bd\bd\bd r\br\br\bru\bu\bu\bul\bl\bl\ble\be\be\bes\bs\bs\bs:\b:\b:\b:
The following exceptions apply to the above rules:
- `""""' If the empty string `""' is the only command line
+ """" If the empty string "" is the only command line
argument in the _\bs_\bu_\bd_\bo_\be_\br_\bs entry it means that com
mand is not allowed to be run with a\ba\ba\ban\bn\bn\bny\by\by\by arguments.
+
+
+December 13, 2001 1.6.4 13
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
O\bO\bO\bOt\bt\bt\bth\bh\bh\bhe\be\be\ber\br\br\br s\bs\bs\bsp\bp\bp\bpe\be\be\bec\bc\bc\bci\bi\bi\bia\ba\ba\bal\bl\bl\bl c\bc\bc\bch\bh\bh\bha\ba\ba\bar\br\br\bra\ba\ba\bac\bc\bc\bct\bt\bt\bte\be\be\ber\br\br\brs\bs\bs\bs a\ba\ba\ban\bn\bn\bnd\bd\bd\bd r\br\br\bre\be\be\bes\bs\bs\bse\be\be\ber\br\br\brv\bv\bv\bve\be\be\bed\bd\bd\bd w\bw\bw\bwo\bo\bo\bor\br\br\brd\bd\bd\bds\bs\bs\bs:\b:\b:\b:
The pound sign ('#') is used to indicate a comment (unless
The reserved word A\bA\bA\bAL\bL\bL\bLL\bL\bL\bL is a built in _\ba_\bl_\bi_\ba_\bs that always
causes a match to succeed. It can be used wherever one
- might otherwise use a `Cmnd_Alias', `User_Alias',
- `Runas_Alias', or `Host_Alias'. You should not try to
- define your own _\ba_\bl_\bi_\ba_\bs called A\bA\bA\bAL\bL\bL\bLL\bL\bL\bL as the built in alias
- will be used in preference to your own. Please note that
- using A\bA\bA\bAL\bL\bL\bLL\bL\bL\bL can be dangerous since in a command context, it
- allows the user to run a\ba\ba\ban\bn\bn\bny\by\by\by command on the system.
+ might otherwise use a Cmnd_Alias, User_Alias, Runas_Alias,
+ or Host_Alias. You should not try to define your own
+ _\ba_\bl_\bi_\ba_\bs called A\bA\bA\bAL\bL\bL\bLL\bL\bL\bL as the built in alias will be used in
+ preference to your own. Please note that using A\bA\bA\bAL\bL\bL\bLL\bL\bL\bL can be
+ dangerous since in a command context, it allows the user
+ to run a\ba\ba\ban\bn\bn\bny\by\by\by command on the system.
An exclamation point ('!') can be used as a logical _\bn_\bo_\bt
- operator both in an _\ba_\bl_\bi_\ba_\bs and in front of a `Cmnd'. This
+ operator both in an _\ba_\bl_\bi_\ba_\bs and in front of a Cmnd. This
allows one to exclude certain values. Note, however, that
- using a `!' in conjunction with the built in `ALL' alias
- to allow a user to run "all but a few" commands rarely
- works as intended (see SECURITY NOTES below).
+ using a ! in conjunction with the built in ALL alias to
+ allow a user to run "all but a few" commands rarely works
+ as intended (see SECURITY NOTES below).
Long lines can be continued with a backslash ('\') as the
last character on the line.
- Whitespace between elements in a list as well as specicial
+ Whitespace between elements in a list as well as special
syntactic characters in a _\bU_\bs_\be_\br _\bS_\bp_\be_\bc_\bi_\bf_\bi_\bc_\ba_\bt_\bi_\bo_\bn ('=', ':',
'(', ')') is optional.
-
-
-December 29, 2000 1.6.4 13
-
-
-
-
-
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-
-
The following characters must be escaped with a backslash
- ('\') when used as part of a word (eg. a username or host
- name): '@', '!', '=', ':', ',', '(', ')', '\'.
+ ('\') when used as part of a word (e.g. a username or
+ hostname): '@', '!', '=', ':', ',', '(', ')', '\'.
E\bE\bE\bEX\bX\bX\bXA\bA\bA\bAM\bM\bM\bMP\bP\bP\bPL\bL\bL\bLE\bE\bE\bES\bS\bS\bS
Below are example _\bs_\bu_\bd_\bo_\be_\br_\bs entries. Admittedly, some of
Runas_Alias OP = root, operator
Runas_Alias DB = oracle, sybase
+
+
+
+
+
+
+
+
+
+December 13, 2001 1.6.4 14
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
# Host alias specification
Host_Alias SPARC = bigtime, eclipse, moet, anchor :\
SGI = grolsch, dandelion, black :\
in all cases. We don't want to subject the full time
staff to the s\bs\bs\bsu\bu\bu\bud\bd\bd\bdo\bo\bo\bo lecture, and user m\bm\bm\bmi\bi\bi\bil\bl\bl\bll\bl\bl\ble\be\be\ber\br\br\brt\bt\bt\bt need not give
a password. In addition, on the machines in the _\bS_\bE_\bR_\bV_\bE_\bR_\bS
- `Host_Alias', we keep an additional local log file and
- make sure we log the year in each log line since the log
+ Host_Alias, we keep an additional local log file and make
+ sure we log the year in each log line since the log
entries will be kept around for several years.
# Override built in defaults
Defaults:millert !authenticate
Defaults@SERVERS log_year, logfile=/var/log/sudo.log
-
-
-December 29, 2000 1.6.4 14
-
-
-
-
-
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-
-
The _\bU_\bs_\be_\br _\bs_\bp_\be_\bc_\bi_\bf_\bi_\bc_\ba_\bt_\bi_\bo_\bn is the part that actually deter
mines who may run what.
PARTTIMERS ALL = ALL
+
+
+
+December 13, 2001 1.6.4 15
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
Part time sysadmins (b\bb\bb\bbo\bo\bo\bos\bs\bs\bst\bt\bt\btl\bl\bl\ble\be\be\bey\by\by\by, j\bj\bj\bjw\bw\bw\bwf\bf\bf\bfo\bo\bo\box\bx\bx\bx, and c\bc\bc\bcr\br\br\bra\ba\ba\baw\bw\bw\bwl\bl\bl\bl) may run
any command on any host but they must authenticate them
- selves first (since the entry lacks the `NOPASSWD' tag).
+ selves first (since the entry lacks the NOPASSWD tag).
jack CSNETS = ALL
The user j\bj\bj\bja\ba\ba\bac\bc\bc\bck\bk\bk\bk may run any command on the machines in the
- _\bC_\bS_\bN_\bE_\bT_\bS alias (the networks `128.138.243.0',
- `128.138.204.0', and `128.138.242.0'). Of those networks,
- only <128.138.204.0> has an explicit netmask (in CIDR
- notation) indicating it is a class C network. For the
- other networks in _\bC_\bS_\bN_\bE_\bT_\bS, the local machine's netmask will
- be used during matching.
+ _\bC_\bS_\bN_\bE_\bT_\bS alias (the networks 128.138.243.0, 128.138.204.0,
+ and 128.138.242.0). Of those networks, only 128.138.204.0
+ has an explicit netmask (in CIDR notation) indicating it
+ is a class C network. For the other networks in _\bC_\bS_\bN_\bE_\bT_\bS,
+ the local machine's netmask will be used during matching.
lisa CUNETS = ALL
The user l\bl\bl\bli\bi\bi\bis\bs\bs\bsa\ba\ba\ba may run any command on any host in the
- _\bC_\bU_\bN_\bE_\bT_\bS alias (the class B network `128.138.0.0').
+ _\bC_\bU_\bN_\bE_\bT_\bS alias (the class B network 128.138.0.0).
operator ALL = DUMPS, KILL, PRINTING, SHUTDOWN, HALT, REBOOT,\
/usr/oper/bin/
assumes _\bp_\ba_\bs_\bs_\bw_\bd(1) does not take multiple usernames on the
command line.
-
-
-
-December 29, 2000 1.6.4 15
-
-
-
-
-
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-
-
bob SPARC = (OP) ALL : SGI = (OP) ALL
The user b\bb\bb\bbo\bo\bo\bob\bb\bb\bb may run anything on the _\bS_\bP_\bA_\bR_\bC and _\bS_\bG_\bI
- machines as any user listed in the _\bO_\bP `Runas_Alias' (r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt
+ machines as any user listed in the _\bO_\bP Runas_Alias (r\br\br\bro\bo\bo\boo\bo\bo\bot\bt\bt\bt
and o\bo\bo\bop\bp\bp\bpe\be\be\ber\br\br\bra\ba\ba\bat\bt\bt\bto\bo\bo\bor\br\br\br).
jim +biglab = ALL
printers as well as add and remove users, so they are
allowed to run those commands on all machines.
+
+
+December 13, 2001 1.6.4 16
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
fred ALL = (DB) NOPASSWD: ALL
The user f\bf\bf\bfr\br\br\bre\be\be\bed\bd\bd\bd can run commands as any user in the _\bD_\bB
- `Runas_Alias' (o\bo\bo\bor\br\br\bra\ba\ba\bac\bc\bc\bcl\bl\bl\ble\be\be\be or s\bs\bs\bsy\by\by\byb\bb\bb\bba\ba\ba\bas\bs\bs\bse\be\be\be) without giving a pass
- word.
+ Runas_Alias (o\bo\bo\bor\br\br\bra\ba\ba\bac\bc\bc\bcl\bl\bl\ble\be\be\be or s\bs\bs\bsy\by\by\byb\bb\bb\bba\ba\ba\bas\bs\bs\bse\be\be\be) without giving a password.
john ALPHA = /usr/bin/su [!-]*, !/usr/bin/su *root*
jen ALL, !SERVERS = ALL
The user j\bj\bj\bje\be\be\ben\bn\bn\bn may run any command on any machine except for
- those in the _\bS_\bE_\bR_\bV_\bE_\bR_\bS `Host_Alias' (master, mail, www and
+ those in the _\bS_\bE_\bR_\bV_\bE_\bR_\bS Host_Alias (master, mail, www and
ns).
jill SERVERS = /usr/bin/, !SU, !SHELLS
- For any machine in the _\bS_\bE_\bR_\bV_\bE_\bR_\bS `Host_Alias', j\bj\bj\bji\bi\bi\bil\bl\bl\bll\bl\bl\bl may run
+ For any machine in the _\bS_\bE_\bR_\bV_\bE_\bR_\bS Host_Alias, j\bj\bj\bji\bi\bi\bil\bl\bl\bll\bl\bl\bl may run
any commands in the directory /usr/bin/ except for those
- commands belonging to the _\bS_\bU and _\bS_\bH_\bE_\bL_\bL_\bS `Cmnd_Aliases'.
+ commands belonging to the _\bS_\bU and _\bS_\bH_\bE_\bL_\bL_\bS Cmnd_Aliases.
steve CSNETS = (operator) /usr/local/op_commands/
WEBMASTERS www = (www) ALL, (root) /usr/bin/su www
- On the host www, any user in the _\bW_\bE_\bB_\bM_\bA_\bS_\bT_\bE_\bR_\bS `User_Alias'
-
-
-
-December 29, 2000 1.6.4 16
-
-
-
-
-
-sudoers(4) MAINTENANCE COMMANDS sudoers(4)
-
-
+ On the host www, any user in the _\bW_\bE_\bB_\bM_\bA_\bS_\bT_\bE_\bR_\bS User_Alias
(will, wendy, and wim), may run any command as user www
(which owns the web pages) or simply _\bs_\bu(1) to www.
/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM
Any user may mount or unmount a CD-ROM on the machines in
- the CDROM `Host_Alias' (orion, perseus, hercules) without
+ the CDROM Host_Alias (orion, perseus, hercules) without
entering a password. This is a bit tedious for users to
- type, so it is a prime candiate for encapsulating in a
+ type, so it is a prime candidate for encapsulating in a
shell script.
S\bS\bS\bSE\bE\bE\bEC\bC\bC\bCU\bU\bU\bUR\bR\bR\bRI\bI\bI\bIT\bT\bT\bTY\bY\bY\bY N\bN\bN\bNO\bO\bO\bOT\bT\bT\bTE\bE\bE\bES\bS\bS\bS
It is generally not effective to "subtract" commands from
- `ALL' using the '!' operator. A user can trivially cir
- cumvent this by copying the desired command to a different
+ ALL using the '!' operator. A user can trivially circum
+ vent this by copying the desired command to a different
name and then executing that. For example:
bill ALL = ALL, !SU, !SHELLS
+
+
+December 13, 2001 1.6.4 17
+
+
+
+
+
+sudoers(4) MAINTENANCE COMMANDS sudoers(4)
+
+
Doesn't really prevent b\bb\bb\bbi\bi\bi\bil\bl\bl\bll\bl\bl\bl from running the commands
listed in _\bS_\bU or _\bS_\bH_\bE_\bL_\bL_\bS since he can simply copy those com
mands to a different name, or use a shell escape from an
When using netgroups of machines (as opposed to users), if
you store fully qualified hostnames in the netgroup (as is
usually the case), you either need to have the machine's
- hostname be fully qualified as returned by the `hostname'
+ hostname be fully qualified as returned by the hostname
command or use the _\bf_\bq_\bd_\bn option in _\bs_\bu_\bd_\bo_\be_\br_\bs.
F\bF\bF\bFI\bI\bI\bIL\bL\bL\bLE\bE\bE\bES\bS\bS\bS
-December 29, 2000 1.6.4 17
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+December 13, 2001 1.6.4 18
-.\" Automatically generated by Pod::Man version 1.04
-.\" Fri Dec 29 20:44:35 2000
+.\" Automatically generated by Pod::Man version 1.15
+.\" Thu Dec 13 23:43:32 2001
.\"
.\" Standard preamble:
.\" ======================================================================
. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
. ds L" ""
. ds R" ""
-. ds C` `
-. ds C' '
+. ds C`
+. ds C'
'br\}
.el\{\
. ds -- \|\(em\|
.if \nF \{\
. de IX
. tm Index:\\$1\t\\n%\t"\\$2"
-. .
+..
. nr % 0
. rr F
.\}
.\" ======================================================================
.\"
.IX Title "sudoers @mansectform@"
-.TH sudoers @mansectform@ "1.6.4" "December 29, 2000" "MAINTENANCE COMMANDS"
+.TH sudoers @mansectform@ "1.6.4" "December 13, 2001" "MAINTENANCE COMMANDS"
.UC
.SH "NAME"
sudoers \- list of which users may execute what
.SH "DESCRIPTION"
.IX Header "DESCRIPTION"
-The \fIsudoers\fR file is composed two types of entries:
+The \fIsudoers\fR file is composed of two types of entries:
aliases (basically variables) and user specifications
(which specify who may run what). The grammar of \fIsudoers\fR
will be described below in Extended Backus-Naur Form (\s-1EBNF\s0).
-Don't despair if you don't know what \s-1EBNF\s0 is, it is fairly
-simple and the definitions below are annotated.
+Don't despair if you don't know what \s-1EBNF\s0 is; it is fairly
+simple, and the definitions below are annotated.
.Sh "Quick guide to \s-1EBNF\s0"
.IX Subsection "Quick guide to EBNF"
\&\s-1EBNF\s0 is a concise and exact way of describing the grammar of a language.
-Each \s-1EBNF\s0 definition is made up of \fIproduction rules\fR. Eg.
+Each \s-1EBNF\s0 definition is made up of \fIproduction rules\fR. E.g.,
.PP
.Vb 1
\& symbol ::= definition | alternate1 | alternate2 ...
string (as opposed to a symbol name).
.Sh "Aliases"
.IX Subsection "Aliases"
-There are four kinds of aliases: the \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR,
+There are four kinds of aliases: \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR,
\&\f(CW\*(C`Host_Alias\*(C'\fR and \f(CW\*(C`Cmnd_Alias\*(C'\fR.
.PP
.Vb 4
-\& Alias ::= 'User_Alias' = User_Alias (':' User_Alias)* |
-\& 'Runas_Alias' = Runas_Alias (':' Runas_Alias)* |
-\& 'Host_Alias' = Host_Alias (':' Host_Alias)* |
-\& 'Cmnd_Alias' = Cmnd_Alias (':' Cmnd_Alias)*
+\& Alias ::= 'User_Alias' User_Alias (':' User_Alias)* |
+\& 'Runas_Alias' Runas_Alias (':' Runas_Alias)* |
+\& 'Host_Alias' Host_Alias (':' Host_Alias)* |
+\& 'Cmnd_Alias' Cmnd_Alias (':' Cmnd_Alias)*
.Ve
.Vb 1
\& User_Alias ::= NAME '=' User_List
\& Alias_Type NAME = item1, item2, ...
.Ve
where \fIAlias_Type\fR is one of \f(CW\*(C`User_Alias\*(C'\fR, \f(CW\*(C`Runas_Alias\*(C'\fR, \f(CW\*(C`Host_Alias\*(C'\fR,
-or \f(CW\*(C`Cmnd_Alias\*(C'\fR. A \f(CW\*(C`NAME\*(C'\fR is a string of upper case letters, numbers,
+or \f(CW\*(C`Cmnd_Alias\*(C'\fR. A \f(CW\*(C`NAME\*(C'\fR is a string of uppercase letters, numbers,
and the underscore characters ('_'). A \f(CW\*(C`NAME\*(C'\fR \fBmust\fR start with an
-upper case letter. It is possible to put several alias definitions
-of the same type on a single line, joined by a colon (':'). Eg.
+uppercase letter. It is possible to put several alias definitions
+of the same type on a single line, joined by a colon (':'). E.g.,
.PP
.Vb 1
\& Alias_Type NAME = item1, item2, item3 : NAME = item4, item5
(prefixed with '#'), System groups (prefixed with '%'),
netgroups (prefixed with '+') and other aliases. Each list
item may be prefixed with one or more '!' operators. An odd number
-of '!' operators negates the value of the item; an even number
+of '!' operators negate the value of the item; an even number
just cancel each other out.
.PP
.Vb 2
Again, the value of an item may be negated with the '!' operator.
If you do not specify a netmask with a network number, the netmask
of the host's ethernet \fIinterface\fR\|(s) will be used when matching.
-The netmask may be specified either in dotted quad notation (eg.
-255.255.255.0) or \s-1CIDR\s0 notation (number of bits, eg. 24). A hostname
+The netmask may be specified either in dotted quad notation (e.g.
+255.255.255.0) or \s-1CIDR\s0 notation (number of bits, e.g. 24). A hostname
may include shell-style wildcards (see `Wildcards' section below),
but unless the \f(CW\*(C`hostname\*(C'\fR command on your machine returns the fully
qualified hostname, you'll need to use the \fIfqdn\fR option for wildcards
aliases. A commandname is a fully qualified filename which may include
shell-style wildcards (see `Wildcards' section below). A simple
filename allows the user to run the command with any arguments he/she
-wishes. However, you may also command line arguments (including wildcards).
-Alternately, you can specify \f(CW\*(C`""\*(C'\fR to indicate that the command
+wishes. However, you may also specify command line arguments (including
+wildcards). Alternately, you can specify \f(CW\*(C`""\*(C'\fR to indicate that the command
may only be run \fBwithout\fR command line arguments. A directory is a
fully qualified pathname ending in a '/'. When you specify a directory
in a \f(CW\*(C`Cmnd_List\*(C'\fR, the user will be able to run any file within that directory
.Vb 1
\& Default_Entry ::= Default_Type Parameter_List
.Ve
-.Vb 2
+.Vb 4
\& Parameter ::= Parameter '=' Value ||
+\& Parameter '+=' Value ||
+\& Parameter '-=' Value ||
\& '!'* Parameter ||
.Ve
-Parameters may be \fBflags\fR, \fBinteger\fR values, or \fBstrings\fR. Flags
-are implicitly boolean and can be turned off via the '!' operator.
-Some integer and string parameters may also be used in a boolean
-context to disable them. Values may be enclosed in double quotes
-(\f(CW\*(C`"\*(C'\fR) when they contain multiple words. Special characters may
-be escaped with a backslash (\f(CW\*(C`\e\*(C'\fR).
+Parameters may be \fBflags\fR, \fBinteger\fR values, \fBstrings\fR, or \fBlists\fR.
+Flags are implicitly boolean and can be turned off via the '!'
+operator. Some integer, string and list parameters may also be
+used in a boolean context to disable them. Values may be enclosed
+in double quotes (\f(CW\*(C`"\*(C'\fR) when they contain multiple words. Special
+characters may be escaped with a backslash (\f(CW\*(C`\e\*(C'\fR).
+.PP
+Lists have two additional assignment operators, \f(CW\*(C`+=\*(C'\fR and \f(CW\*(C`\-=\*(C'\fR.
+These operators are used to add to and delete from a list respectively.
+It is not an error to use the \f(CW\*(C`\-=\*(C'\fR operator to remove an element
+that does not exist in a list.
.PP
\&\fBFlags\fR:
.Ip "long_otp_prompt" 12
.IX Item "mail_always"
Send mail to the \fImailto\fR user every time a users runs \fBsudo\fR.
This flag is \fIoff\fR by default.
+.Ip "mail_badpass" 12
+.IX Item "mail_badpass"
+Send mail to the \fImailto\fR user if the user running sudo does not
+enter the correct password. This flag is \fIoff\fR by default.
.Ip "mail_no_user" 12
.IX Item "mail_no_user"
If set, mail will be sent to the \fImailto\fR user if the invoking
.Ip "fqdn" 12
.IX Item "fqdn"
Set this flag if you want to put fully qualified hostnames in the
-\&\fIsudoers\fR file. Ie: instead of myhost you would use myhost.mydomain.edu.
+\&\fIsudoers\fR file. I.e.: instead of myhost you would use myhost.mydomain.edu.
You may still use the short form if you wish (and even mix the two).
Beware that turning on \fIfqdn\fR requires \fBsudo\fR to make \s-1DNS\s0 lookups
which may make \fBsudo\fR unusable if \s-1DNS\s0 stops working (for example
.Ip "env_reset" 12
.IX Item "env_reset"
If set, \fBsudo\fR will reset the environment to only contain the
-following variables: \f(CW\*(C`HOME\*(C'\fR, \f(CW\*(C`SHELL\*(C'\fR, \f(CW\*(C`LOGNAME\*(C'\fR, and \f(CW\*(C`USER\*(C'\fR
-(in addition to the \f(CW\*(C`SUDO_*\*(C'\fR variables). The \f(CW\*(C`PATH\*(C'\fR and \f(CW\*(C`TERM\*(C'\fR
-environment variables are preserved unaltered. Other specific variables
-may be preserved with the i<env_keep> option.
+following variables: \f(CW\*(C`HOME\*(C'\fR, \f(CW\*(C`LOGNAME\*(C'\fR, \f(CW\*(C`PATH\*(C'\fR, \f(CW\*(C`SHELL\*(C'\fR, \f(CW\*(C`TERM\*(C'\fR,
+and \f(CW\*(C`USER\*(C'\fR (in addition to the \f(CW\*(C`SUDO_*\*(C'\fR variables).
+Of these, only \f(CW\*(C`TERM\*(C'\fR is copied unaltered from the old environment.
+The other variables are set to default values (possibly modified
+by the value of the \fIset_logname\fR option). If \fBsudo\fR was compiled
+with the \f(CW\*(C`SECURE_PATH\*(C'\fR option, its value will be used for the \f(CW\*(C`PATH\*(C'\fR
+environment variable.
+Other variables may be preserved with the i<env_keep> option.
.Ip "use_loginclass" 12
.IX Item "use_loginclass"
If set, \fBsudo\fR will apply the defaults specified for the target user's
.Ip "timestamp_timeout" 12
.IX Item "timestamp_timeout"
Number of minutes that can elapse before \fBsudo\fR will ask for a
-passwd again. The default is \f(CW\*(C`@timeout@\*(C'\fR, set this to \f(CW\*(C`0\*(C'\fR to always
+passwd again. The default is \f(CW\*(C`@timeout@\*(C'\fR. Set this to \f(CW\*(C`0\*(C'\fR to always
prompt for a password.
+If set to a value less than \f(CW\*(C`0\*(C'\fR the user's timestamp will never
+expire. This can be used to allow users to create or delete their
+own timestamps via \f(CW\*(C`sudo \-v\*(C'\fR and \f(CW\*(C`sudo \-k\*(C'\fR respectively.
.Ip "passwd_timeout" 12
.IX Item "passwd_timeout"
Number of minutes before the \fBsudo\fR password prompt times out.
.IX Item "syslog_badpri"
Syslog priority to use when user authenticates unsuccessfully.
Defaults to \f(CW\*(C`@badpri@\*(C'\fR.
-.Ip "env_keep" 12
-.IX Item "env_keep"
-A double-quoted, space-separated list of environment variables
-to be preserved in the user's environment. When used in conjuction
-with the \fIenv_reset\fR option, this allows fine control over the
-environment \fBsudo\fR\-spawned processes will get. If the \fIenv_reset\fR
-option is not used, \fIenv_keep\fR can be used to make exceptions to
-the built in list of \*(L"dangerous\*(R" environment variables.
.Ip "editor" 12
.IX Item "editor"
A colon (':') separated list of editors allowed to be used with
.Ip "logfile" 12
.IX Item "logfile"
Path to the \fBsudo\fR log file (not the syslog log file). Setting a path
-turns on logging to a file, negating this option turns it off.
+turns on logging to a file; negating this option turns it off.
.Ip "syslog" 12
.IX Item "syslog"
Syslog facility if syslog is being used for logging (negate to
Flags to use when invoking mailer. Defaults to \fB\-t\fR.
.Ip "mailto" 12
.IX Item "mailto"
-Address to send warning and erorr mail to. The address should
+Address to send warning and error mail to. The address should
be enclosed in double quotes (\f(CW\*(C`"\*(C'\fR) to protect against sudo
interpreting the \f(CW\*(C`@\*(C'\fR sign. Defaults to \f(CW\*(C`@mailto@\*(C'\fR.
.Ip "exempt_group" 12
.IX Item "exempt_group"
Users in this group are exempt from password and \s-1PATH\s0 requirements.
This is not set by default.
-.Ip "secure_path" 12
-.IX Item "secure_path"
-Path used for every command run from \fBsudo\fR. If you don't trust the
-people running \fBsudo\fR to have a sane \f(CW\*(C`PATH\*(C'\fR environment variable you may
-want to use this. Another use is if you want to have the \*(L"root path\*(R"
-be separate from the \*(L"user path.\*(R" This is not set by default.
.Ip "verifypw" 12
.IX Item "verifypw"
This option controls when a password will be required when a user runs
.Ve
The default value is `any'.
.PP
+\&\fBLists that can be used in a boolean context\fR:
+.Ip "env_check" 12
+.IX Item "env_check"
+A double-quoted, space-separated list of environment variables to
+be removed from the user's environment if the variable's value
+contains \f(CW\*(C`%\*(C'\fR or \f(CW\*(C`/\*(C'\fR characters. This can be used to guard against
+printf-style format vulnerabilties in poorly-written programs. The
+list can be replaced, added to, deleted from, or disabled by using
+the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, and <!> operators respectively. The default
+list of environment variable to check is printed when \fBsudo\fR is
+run by root with the \fI\-V\fR option.
+.Ip "env_delete" 12
+.IX Item "env_delete"
+A double-quoted, space-separated list of environment variables to
+be removed from the user's environment. The list can be replaced,
+added to, deleted from, or disabled by using the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR,
+and <!> operators respectively. The default list of environment
+variable to remove is printed when \fBsudo\fR is run by root with the
+\&\fI\-V\fR option.
+.Ip "env_keep" 12
+.IX Item "env_keep"
+A double-quoted, space-separated list of environment variables to
+be preserved in the user's environment when the \fIenv_reset\fR option
+is in effect. This allows fine-grained control over the environment
+\&\fBsudo\fR\-spawned processes will get. The list can be replaced, added
+to, deleted from, or disabled by using the \f(CW\*(C`=\*(C'\fR, \f(CW\*(C`+=\*(C'\fR, \f(CW\*(C`\-=\*(C'\fR, and
+<!> operators respectively. This list has no default members.
+.PP
When logging via \fIsyslog\fR\|(3), \fBsudo\fR accepts the following values for the syslog
facility (the value of the \fBsyslog\fR Parameter): \fBauthpriv\fR (if your \s-1OS\s0
supports it), \fBauth\fR, \fBdaemon\fR, \fBuser\fR, \fBlocal0\fR, \fBlocal1\fR, \fBlocal2\fR,
.Sh "User Specification"
.IX Subsection "User Specification"
.Vb 2
-\& User_Spec ::= User_list Host_List '=' User_List Cmnd_Spec_List \e
+\& User_Spec ::= User_list Host_List '=' Cmnd_Spec_List \e
\& (':' User_Spec)*
.Ve
.Vb 2
.Ve
A \fBuser specification\fR determines which commands a user may run
(and as what user) on specified hosts. By default, commands are
-run as \fBroot\fR but this can be changed on a per-command basis.
+run as \fBroot\fR, but this can be changed on a per-command basis.
.PP
Let's break that down into its constituent parts:
.Sh "Runas_Spec"
\& dgb boulder = (operator) /bin/ls, /bin/kill, /usr/bin/who
.Ve
The user \fBdgb\fR may run \fI/bin/ls\fR, \fI/bin/kill\fR, and
-\&\fI/usr/bin/lprm\fR \*(-- but only as \fBoperator\fR. Eg.
+\&\fI/usr/bin/lprm\fR \*(-- but only as \fBoperator\fR. E.g.,
.PP
.Vb 1
\& sudo -u operator /bin/ls.
.Vb 1
\& ray rushmore = NOPASSWD: /bin/kill, PASSWD: /bin/ls, /usr/bin/lprm
.Ve
-Note however, that the \f(CW\*(C`PASSWD\*(C'\fR tag has no effect on users who are
+Note, however, that the \f(CW\*(C`PASSWD\*(C'\fR tag has no effect on users who are
in the group specified by the exempt_group option.
.PP
By default, if the \f(CW\*(C`NOPASSWD\*(C'\fR tag is applied to any of the entries
.Sh "Exceptions to wildcard rules:"
.IX Subsection "Exceptions to wildcard rules:"
The following exceptions apply to the above rules:
-.if n .Ip "\f(CW\*(C`""""""""\*(C'\fR" 8
-.el .Ip "\f(CW\*(C```''\*(C'\fR" 8
+.if n .Ip "\f(CW""""""""\fR" 8
+.el .Ip "\f(CW``''\fR" 8
.IX Item """""
If the empty string \f(CW\*(C`""\*(C'\fR is the only command line argument in the
\&\fIsudoers\fR entry it means that command is not allowed to be run
Long lines can be continued with a backslash ('\e') as the last
character on the line.
.PP
-Whitespace between elements in a list as well as specicial syntactic
+Whitespace between elements in a list as well as special syntactic
characters in a \fIUser Specification\fR ('=', ':', '(', ')') is optional.
.PP
The following characters must be escaped with a backslash ('\e') when
-used as part of a word (eg. a username or hostname):
+used as part of a word (e.g. a username or hostname):
\&'@', '!', '=', ':', ',', '(', ')', '\e'.
.SH "EXAMPLES"
.IX Header "EXAMPLES"
.Ve
The user \fBjack\fR may run any command on the machines in the \fI\s-1CSNETS\s0\fR alias
(the networks \f(CW\*(C`128.138.243.0\*(C'\fR, \f(CW\*(C`128.138.204.0\*(C'\fR, and \f(CW\*(C`128.138.242.0\*(C'\fR).
-Of those networks, only <128.138.204.0> has an explicit netmask (in
+Of those networks, only \f(CW\*(C`128.138.204.0\*(C'\fR has an explicit netmask (in
\&\s-1CIDR\s0 notation) indicating it is a class C network. For the other
networks in \fI\s-1CSNETS\s0\fR, the local machine's netmask will be used
during matching.
.Ve
Any user may mount or unmount a \s-1CD-ROM\s0 on the machines in the \s-1CDROM\s0
\&\f(CW\*(C`Host_Alias\*(C'\fR (orion, perseus, hercules) without entering a password.
-This is a bit tedious for users to type, so it is a prime candiate
+This is a bit tedious for users to type, so it is a prime candidate
for encapsulating in a shell script.
.SH "SECURITY NOTES"
.IX Header "SECURITY NOTES"